nextcloud / text

📑 Collaborative document editing using Markdown
GNU Affero General Public License v3.0
555 stars 91 forks source link

Text editor is always used as default editor for Markdown files no matter what other applications are installed #439

Closed noe-spi closed 4 years ago

noe-spi commented 4 years ago

When installing Nextcloud Markdown Editor (Link) and trying to open a xx.md or xx.mardown file the text editor opens.

To Reproduce

  1. install Nextcloud Markdown Editor
  2. Create a new file (or use an existing one) that shall be a markdown file (xx.md / xx.markdown)
  3. Click on the newly created file to open
  4. See error --> Text Editor will open and nor the Markdown Editor

Expected behavior Markdown Editor shall open

Client details:

Text app version: 1.1.1

Operating system: Linux (Ubuntu 18.04) running as docker image Web server: Apache Database: MySQL PHP version: 7.2 Nextcloud version: (see Nextcloud admin page) 17.0.1

rollanders commented 4 years ago

Another problem - I deactivated Text, and had still Markdown editor activated, but now the md-file is not opened but the download windows opens. I want the Markdown editor to edit my index.md files for PicoCMS. Especially the yaml-header. The Text-app destroys the header. As a workaround I can change the md-extension to txt and try open it in only office.

ufgum commented 4 years ago

Same problem here. The PicoCMS needs the yaml-header, but text destroys it.

noe-spi commented 4 years ago

see mitigation for a solution wrt markdown editor. But the main problem is here I think: Nextclouds decision to focus on the new Text app and discontinue the development of the old plain text editor

juliusknorr commented 4 years ago

@jancborchardt Not sure what we should do here from a UX perspective. Should the markdown editor take precedence over the text app when installed?

E1k3 commented 4 years ago

@juliushaertl As long as the markdown editor is even working (ie when the old text editor app is installed), it is possible to open a md file in the markdown editor via the context menu. While this is not perfect, it is something I could accept. In the long run, I would prefer a system, where you can select preferred apps for certain filetypes (maybe this exists already, I am certainly not using Nextcloud to its fullest potential right now).

The real problem right now is, that the old TextEditor App was taken off the store and without it, the markdown editor does not work at all.

blvb commented 4 years ago

It is necessary to change min-version to 17 in apps/files_texteditor/appinfo/info.xml Seems to work properly now for NC 17.0.1

jancborchardt commented 4 years ago

So this doesn’t seem to be 1 big issue but several smaller ones which need to be treated separately and can be fixed separately too:


I want the Markdown editor to edit my index.md files for PicoCMS. Especially the yaml-header. The Text-app destroys the header.

@rollanders @ufgum this of course is an issue which should ideally be fixed in the Text app. Could you open a separate issue about this? → https://github.com/nextcloud/text/issues/439


@noe-spi @E1k3 @inpos @lanxu @blvb what are the actual issues you encounter with Nextcloud Text as Markdown editor which could possibly be fixed? :) Could you open separate issues about those too? → https://github.com/nextcloud/text/issues/new


The real problem right now is, that the old TextEditor App was taken off the store and without it, the markdown editor does not work at all.

@E1k3 this is an issue that should be fixed in the Markdown app → https://github.com/icewind1991/files_markdown cc @icewind1991


That leaves the question to decide: When both Nextcloud Text (default) and the Markdown app are installed, what should open if you open a Markdown file?

@juliushaertl Until these questions are resolved I’d prefer to keep the current state. But understand this is not set in stone – there’s just many small steps to take instead of one big fix. :)

E1k3 commented 4 years ago

@E1k3 this is an issue that should be fixed in the Markdown app → https://github.com/icewind1991/files_markdown cc @icewind1991

As far as I understand, the Markdown app was just an extension of the old TextEditor app maintained by the Nextcloud team. While I agree, that this is not a problem related to the new Text app (so not one to discuss here, but in the TextEditor repo https://github.com/nextcloud/files_texteditor/issues/185), I wouldn't call it a bug/problem of the Markdown app either. The TextEditor app vanishing from the store should not have to be fixed by the extensions that were developed for it.

@noe-spi @E1k3 @inpos @lanxu @blvb what are the actual issues you encounter with Nextcloud Text as Markdown editor which could possibly be fixed? :) Could you open separate issues about those too?

The only issue I have with the Text app, is that is cannot replace a raw + preview editor, but that is not something a WYSIWYG editor will ever do (or is supposed to do), so this doesn't qualify for "could possibly be fixed". The closest I could see for this would be an option to split the preview into a sidebar (but that would result pretty much in the old TextEditor).

shankari commented 4 years ago

I would also like the ability to have a non-rich text editor. I understand that most people want rich text, and the collaborative features are cool.

But sometimes, I just want to write notes to myself, and I already know markdown syntax, so I want to write in plain text so I don't have to take my hands off the keyboard.

The rich text editor has some quirks - e.g. if I type the #### and then <space>, then the hashes disappear, and if I want to go to a higher or lower heading level, then I have to use the dropdown menu. One of the benefits of markdown is that you can type it all as raw text without using the mouse and I would like to keep using that benefit.

I loved the previous plain text editor + preview on the side option, and would really appreciate the ability to configure my running instance to have it as an option.

noe-spi commented 4 years ago

So this doesn’t seem to be 1 big issue but several smaller ones which need to be treated separately and can be fixed separately too:

I want the Markdown editor to edit my index.md files for PicoCMS. Especially the yaml-header. The Text-app destroys the header.

@rollanders @ufgum this of course is an issue which should ideally be fixed in the Text app. Could you open a separate issue about this? → #439

@noe-spi @E1k3 @inpos @lanxu @blvb what are the actual issues you encounter with Nextcloud Text as Markdown editor which could possibly be fixed? :) Could you open separate issues about those too? → https://github.com/nextcloud/text/issues/new

The real problem right now is, that the old TextEditor App was taken off the store and without it, the markdown editor does not work at all.

@E1k3 this is an issue that should be fixed in the Markdown app → https://github.com/icewind1991/files_markdown cc @icewind1991

That leaves the question to decide: When both Nextcloud Text (default) and the Markdown app are installed, what should open if you open a Markdown file?

* **Text:** Is the default, is collaborative.

* **Markdown app:** Is not collaborative, but when you specifically installed it you could argue that you would rather use this one? But why not disable the Text app then?

@juliushaertl Until these questions are resolved I’d prefer to keep the current state. But understand this is not set in stone – there’s just many small steps to take instead of one big fix. :)

... sorry to respond as late - it was not possible to me to react eralier. Let me summarize from my point of view:

1) MarkDown Editor need the old TextEditor - not maintained anymore by Nextcloud

2) the new Text APP do not support the needs by Markdown Editor. Here I would ask if the Text App is the official replacement for TextEditor by Nextcloud? -> I think so

3) Text APP and TextEditor do not coexist in one Nextcloud Instance

4) Text APP opens automatically .md / .markdown files (even if MarkdownEditor &&-|| TextEditor are installed)

==> Conclusio: I agree that this is not an issue in one direction (neither MarkDown nor Text APP), but:

For me it is not clear whom to talk to. On the one hand I would like to use the MarkdownEditor further on but this would mean that both groups are talking to each other. Especially I would be interested in what the developers of MarkdownEditor are guessing as they have that strong dependency to the old TextEditor (which is not supported any more) - are they planning to implement the Text-Engine on their own? Do they talk to Text APP developpers about their need of a text app that is capable to provide raw&preview editor? And I would be interested in the reason why the Text APP developers implement the Text APP the way that it overrules other editors and opens files with file extensions that surely do not belong to them.

noe-spi commented 4 years ago

one question to the round ( and thanks for your engagement - especially to @E1k3 who helped me with his work around ;-) : shall I close this issue or leave it open for further discussions?

E1k3 commented 4 years ago
  1. Text APP opens automatically .md / .markdown files (even if MarkdownEditor &&-|| TextEditor are installed)
  • as the Text APP is a kind of "simple" WHSIWYG Editor - why does this APP automatically open .md/.markdown files and supersede other possible coexisting Editors (at least that is what I experienced)??? For me it is not comprehensible why Text APP open files with well known endings that - for sure - do not belong to Text APP and overrule with that coexisting editors? And THIS was my initial question (as the headline of this issue

Even though the new Text app is a WYSIWYG editor, all of the formatting is done via markdown, so the Text app saves files as .md and is the default app to open .md files as well.

According to the README.md, this is done to enable other editors to edit your documents via markdown as a universal format. Especially on desktops where you want to edit the files in a native text editor instead of the web view, this makes a lot of sense.

As far as I know, it's still possible to edit .md files using another editor plugin/app while "Text" is enabled, using the context menu (right click the file, choose edit with ...). You could test that, by enabling both Text and files_texteditor (the old text editor). I would prefer if there was an option to chose the default app for certain file types though.

Personally, I would prefer a way to split the view of the new Text app into raw and preview panels. This way, this style of editing would remain possible and would be enriched by the new collaboration feature.

E1k3 commented 4 years ago

@shankari wrote

The rich text editor has some quirks - e.g. if I type the #### and then , then the hashes disappear, and if I want to go to a higher or lower heading level, then I have to use the dropdown menu. One of the benefits of markdown is that you can type it all as raw text without using the mouse and I would like to keep using that benefit.

I agree, that this is counter intuitive, but the Text app is really a markdown editor. It just renders the text differently. So when your # characters disappear, they are still there, changing the heading level of the following text and you can still remove heading levels by pressing backspace. They are just not rendered.

This is really weird because, for example, you can only guess the current heading level by the font size.

shankari commented 4 years ago

@E1k3

So when your # characters disappear, they are still there, changing the heading level of the following text and you can still remove heading levels by pressing backspace.

I know that they are still there, but it is jarring and unintutitive. I guess my real issue is that I don't like WSYWIG editors. I prefer to edit the raw text. I understand that I am in a minority, but given that I am running my own instance of nextcloud, I would really be able to configure it in a way that I prefer.

E1k3 commented 4 years ago

@shankari I definitely agree that it is unintuitive and I am not a fan of it either. I will keep using my old vimwiki setup without web editor until there is a supported alternative for nextcloud.

jancborchardt commented 4 years ago

@juliushaertl following up to my previous comment at https://github.com/nextcloud/text/issues/439#issuecomment-563135822

Does it make sense to add a "Plain text" toggle to the Text app?

christianlupus commented 4 years ago

I have also the problem, that I need to change the raw markdown text from time to time. An example is if I let some snippet generate from other sources (browser extension), I need to download the md file, modify using local editor and then reupload. Here a remote raw editing feature would be very helpful.

juliusknorr commented 4 years ago

this of course is an issue which should ideally be fixed in the Text app. Could you open a separate issue about this? → #439

Yes, that is a separate issue.

The real problem right now is, that the old TextEditor App was taken off the store and without it, the markdown editor does not work at all. this is an issue that should be fixed in the Markdown app

We are currently preparing an appstore release of the old text editor so it will work again once that is done https://github.com/nextcloud/files_texteditor/pull/192

When both Nextcloud Text (default) and the Markdown app are installed, what should open if you open a Markdown file?

Text: Is the default, is collaborative. Markdown app: Is not collaborative, but when you specifically installed it you could argue that you would rather use this one? But why not disable the Text app then?

Yes, would make sense I guess to use the markdown editor by default if enabled as this is a conscious decision by the admin. But I need to have a look how the current file actions decide on the precedence.

Does it make sense to add a "Plain text" toggle to the Text app? Is that supported by the editor? >Would it still be collaborative then?

It would make sense, however I expect the implementation to become quite complex as due to the way collaborative editing works, we cannot have different users open the file in different modes (plain/rich) at the same time. Let's say userA opens the file in rich editing mode and then userB opens it in plain editing mode, we need to make sure to end the session of userA and switch it to a plain editing session. Or maybe show a message to userB that this is not possible if multiple users are joined a document. (see https://github.com/nextcloud/text/issues/123#issuecomment-508723049)

Can we do this on a per-document or -filetype basis and remember that? Per document, es with the above limitations. Filetype based doesn't make much sense as it is only about markdown files. Per user also would come with the above described limitations.

Also e.g. by default .html or .css files would of course always be opened as plain text.

This is already the case.

jancborchardt commented 4 years ago

@juliushaertl if we already open html and css files in plain text, it seems a lot of the issues of people here would be fixed simply by adding more filetypes to that list? Like .yml for example – or if that's done already then which else?

juliusknorr commented 4 years ago

if we already open html and css files in plain text, it seems a lot of the issues of people here would be fixed simply by adding more filetypes to that list? Like .yml for example – or if that's done already then which else?

Aparently css/html were missing in the list, since the viewer doesn't support wildcards. So https://github.com/nextcloud/text/pull/509 will add more mime types as a first step.

nikkilocke commented 4 years ago

due to the way collaborative editing works, we cannot have different users open the file in different modes (plain/rich) at the same time

Can you elaborate? It would be nice to fix this!

WarpinWolf commented 4 years ago

As far as I know, it's still possible to edit .md files using another editor plugin/app while "Text" is enabled, using the context menu (right click the file, choose edit with ...).

Sorry - but how would you be able to do this - I do not see "edit with"... image

silverhook commented 4 years ago

To add my two cents, I would also prefer having a split view option with the source side-by-side with the preview.

The issue I am currently running into is that I have a lot MarkDown files with metadata in them – either a YAML block for Pandoc or simpler tag-value for Pelican – and I found the new rich text editor eat the metadata block. Luckily I could recover from an earlier version, but that should not happen. A(n annotated) plain-text mode would get rid of that issue.

zerknorscht commented 4 years ago

I would really love to see it like this: having a "show source code" button (disabled by default) to edit raw and still having the wysiwyg-functionality on what was the preview-pane... if the wysiwyg-pane would respect the code-view-pane an stops fu**ing up the formating (e.g. yaml headers, e.g. by pico-cms in _meta.md) I would be so happy... In fact, I would like to throw a few bucks on it on Bountysource, If I could (don't know how to open bountys) But I drew a nice picture for you: neweditor_mockup

aschoerg commented 4 years ago

I also heavily vote for this issue.

The Editor as-is is confusing if you know markdown, e.g. why are images so small? I searched 5min for the render view to get those images to scale until I found this issue...

Splitting into source and rendered view or even switching would help improving so much! e.g. GitHub/GitLab's way of using the two tabs "Write" and "Preview" when writing this issue.

I don't know the code base but I suggest the .md files are opened in rendered mode and with some button you can enter split-screen to edit the file.

nikkilocke commented 4 years ago

I just right click on the file, and choose "Edit in plain text editor". No problem.

ifuchs commented 4 years ago

@nikkilocke What apps to you have enabled? (Plain text Editor, Text, Markdown Editor, ...?) also, what version of NC? I am not able to edit any of the code type files regardless of which one or which combinmation of htose apps I have enabled. Also, there are no new edit menu items on a right click on my system.

nikkilocke commented 4 years ago

Ah - didn't realise it was an app - thought the developers had listened to this thread. I appear to have something called "Plain text editor".

ifuchs commented 4 years ago

Plain text editor is an app but unless you modify the app's xml info it will not run on v18. What version of NC are you running?

juliusknorr commented 4 years ago

Plain text editor is an app but unless you modify the app's xml info it will not run on v18. What version of NC are you running?

It will as it is now released to the app store.

As a general comment on both split view as well as plain text markdown editing let me quote myself here again: https://github.com/nextcloud/text/issues/123#issuecomment-508723049

... unfortunately I don't see a way to bring this together with the collaborative editing. Prosemirror uses a document model that in our case either supports plaintext or rich editing, but not both at the same time. We have proper plaintext support for non-markdown files with #129 and rich editing for markdown files, which should cover most of the use cases. The markdown editor will still continue to work like before and can be used besides the text app.

Since we aimed for a rich editor this is out of scope for the text app.

So closing this as a won't fix.

rollanders commented 4 years ago

No need any longer. The Plain text editor and Markdown editor now does what I want after their updates.

ifuchs commented 4 years ago

The problem that I still have with the editor is that it adds carriage returns to the end of text files that only have new lines. This in turn causes problems down the line. I have tried changing the parameter in the ace editor to respect line endings but so far I haven’t gotten that to work.

On Fri, Apr 24, 2020 at 4:46 PM rollanders notifications@github.com wrote:

No need any longer. The Plain text editor and Markdown editor now does what I want after their updates.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nextcloud/text/issues/439#issuecomment-619231195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSBUB5AAXQCUMRG67VTROH3BDANCNFSM4JSFUCUQ .

mlncn commented 4 years ago

@nicolad and @rollanders could you confirm that you can add links in markdown syntax - [links](https://example.com) - and then share a preview link to the document that has a formatted link?

I'd like to confirm this works before asking May First Movement Technology (where we use a shared NextCloud) to add the Plain Text Editor app to the instance. Thanks greatly!

rollanders commented 4 years ago

I dont understand exactly what you want to do. Here I did a public page with a link to an internal asset and a second link to an external site. I did the editing of the index.md file using the new plain-text editor. I can choose it from the three dots meny or by right clique on the index.md file. Welcome | testpublic

Welcome testpublic

Pico is a stupidly simple, blazing fast, flat file CMS. |

|

|

Is this what you want?  Tell me when you have checked it so I can remove it. Roland

Den måndag 4 maj 2020 23:40:46 CEST, Benjamin Melançon <notifications@github.com> skrev:  

@nicolad and @rollanders could you confirm that you can add links in markdown syntax - links - and then share a preview link to the document that has a formatted link?

I'd like to confirm this works before asking May First Movement Technology (where we use a shared NextCloud) to add the Plain Text Editor app to the instance. Thanks greatly!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

aschoerg commented 4 years ago

@mlncn

I can confirm that links work: image

The first link is pointing to https://google.com as expected. The second one is somehow useless, since it references relatively, but Nextcloud paths are different: Either you use the webdav path (https://{domain}/remote.php/webdav/{path} which I have not yet found out how to copy since right click opens the nextcloud context menu) or create the internal link (something like https://{domain}/f/123), but this does not open/download the file but opens the directory and marks the file.

Maybe someone has an idea how to easily e.g. use an url for an image? (But can also be ignored since this issue has nothing to do with that :wink:)

rollanders commented 4 years ago

Sorry. You are right.

The text-editor adds 25 to the % sign so that "%assets_url%/Advenstljus.jpg" becomes "%25assets_url25%/Advenstljus.jpg"

This seems to be a bug.

aschoerg commented 4 years ago

Hey cool, thank you for telling me that there would be a way! :+1: Already saw you mentioning here

But basically this is just a url-encode error. But I am not familiar on which side...

rollanders commented 4 years ago

I have not seen this before. It does not seem to be a plain-text issue. It does not matter if I use an external editor. I need to do some checking.

rollanders commented 4 years ago

I cannot link directly to a photo apparently Check it out now

image

aschoerg commented 4 years ago

Just want to inform you, that images work as intendend when using external URLs or relative paths :+1:.

Have not yet tried an absolute path (but most likely I will not use this because I then cannot use it cross-platform in browser, mobile and PC)

shankari commented 4 years ago

@rollanders @juliushaertl

wrt

The markdown editor will still continue to work like before and can be used besides the text app.

No need any longer. The Plain text editor and Markdown editor now does what I want after their updates.

I am not able to open .md files using the Markdown Editor.

When the Text app is enabled, I see a menu item for "Edit in plain text editor", but no menu item for "Edit in markdown editor".

Screen Shot 2020-06-20 at 9 53 42 AM

When the Text app is disabled, there are no menu items, and the file opens in the plain text editor.

Are there specific instructions on how to open .md files with the markdown editor?

Versions:

Screen Shot 2020-06-20 at 10 00 00 AM

Happy to upload logs if necessary.

shankari commented 4 years ago

Answering my own question for people who find this bug in the future.

Note that this option does not appear in the action menu. you have to disable the Text app for the Markdown Editor to work.

binyamin commented 3 years ago

@juliushaertl After reading https://github.com/nextcloud/text/issues/323#issuecomment-538461645, I see that there are problems which plain-text editing would introduce.

Assuming that this feature is unlikely to be introduced in the near future, it would be helpful if the readme linked to https://github.com/nextcloud/text/issues/323#issuecomment-538461645 under a FAQ section. This issue has 42 comments, so it's both important to many users and difficult to process in a passing glance.

Also, I would consider renaming the app to Rich-Text. I didn't even know it supported markdown syntax until I tried. Changing the name will likely clarify the editor's usages and capabilities. I think just renaming the "display name" (or whatever the equivalent is for nextcloud) would be sufficient; URLs and IDs should stay the same.

rollanders commented 3 years ago

I am not sure what is the problem. I guess it is simply a need for a FAQ. I have 4 text editors installed, collabora, onlyoffice, Text and Plain text editor.

I can create new txt-files by using Collabora (Document in the drop down)) or OnlyOffice (New document). In Collabora I need to change the default extension from odt to txt. txt-format is not present in the menu. In OnlyOffice I can choose to save the file in txt format. When I clique on a txt-file it opens by default in the Text-app. It saves in the same format. There is no formating. If I right clique on the txt-file I am given the possibility to edit the file in OnlyOffice and in Plain text editor. If i right clique on the three dots I am also given the possibility to edit with Collabora.

I can create new md-files by choosing New text document from the drop-down menu. If I clique on an md-file it opens in the Text app and I have the formatting menu. This editor mess up the md-files intended for cms_pico pages. If I right clique on the md-file I can choose Edit in the plain text editor which has the option to show the formatted page side by side. I use this editor for the cms_pico files.

I agree that the alternative in the drop-down menu could say New Rich text document for clarity. Maybe it wouls also be good to be able to use the Plain text editor from the drop down menue.

nilsbecker commented 3 years ago

I think there is still undesired behavior here.

When using pico_cms, one writes .md files which include space-sensitive formatting. Currently, merely clicking on such an .md file will make the Text app open it by default, which not only opens the file for display but also modifies it, often destroying the markdown and URL formatting.

This behavior breaks a basic expectation by computer users since the beginning of time: just opening a file with an editor will not modify (or even worse, break) it, especially not in a non-recoverable way.

The problem seems to be that the .md ending is used by the Text app also for its own core functionality which requires some invasive automatic formatting. A possible solution would be to give the Text app its own extension -- something like .text.md that indicates that the file is managed by the Text app and therefore does not behave as a standard file with regards to reading/writing. And to open pure .md files with a plain editor always by default.

E1k3 commented 3 years ago

I think it's ok that the Text app uses .md (markdown) files as long as it adheres to an accepted markdown definition and since markdown definitions are not exactly standardized (CommonMark is an attempt, but not universally adopted), different markdown editors frequently produce slightly different results.

What is definitely not ok, is to change an existing file by just opening it. The app's only job is to conceal the existing markdown syntax and assist in formatting new content. At no point should it change the file without user interaction.

So instead of changing the file extension, I would propose fixing the Text app (i.e. stop changing files without user interaction) and add an option to change default mimetype <-> app associations. This is done on all modern UI environments and as long as Nextcloud allows apps to open certain files, it should also provide a mechanism to make these apps the default application for these file types.

rollanders commented 3 years ago

Something has changed. It seems that I now can edit the pico md-file with the Text app without destroying the pico formatting. I am very impressed. Inserting pictures works OK. The formatting also. So the problem is solved as far as I can see.

szaimen commented 3 years ago

Something has changed. It seems that I now can edit the pico md-file with the Text app without destroying the pico formatting. I am very impressed. Inserting pictures works OK. The formatting also. So the problem is solved as far as I can see.

Interesting! Which NC version are you using?

rollanders commented 3 years ago

I did this on my production server which has NC19.0.8, Pico CMS 1.0.12, Text 3.0.1

rollanders commented 3 years ago

But it is true there are changes in the YAML head of the PICO-md-file - the second line with --- was removed, and the second time I tested it I got a notice of a serverfault. I then opened the md-file in the Simple text editor, removed ## in front of the first line in the YANL-header and readded the second line with --- and now the page was rendered OK.

This is the page when edited in teh Text app Skärmklipp2_210520

This is what it looks like in the Simple text editor. The YAML header has been changed. This file gives server error Skärmklipp1_210520

I edit the YAML header in the Simple text editor Skärmklipp5

This renders OK Skärmklipp4_210520