Skip to content

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

Description

@noe-spi

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:

  • OS: on each OS
  • Browser: firefox, chrome, opera
  • Device: Desktop

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

Activity

  1. rollanders commented on Dec 3, 2019

    @rollanders

    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.

  2. ufgum commented on Dec 3, 2019

    @ufgum

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

  3. noe-spi commented on Dec 3, 2019

    @noe-spi
    Author
  4. juliusknorr commented on Dec 4, 2019

    @juliusknorr
    Member

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

  5. E1k3 commented on Dec 6, 2019

    @E1k3

    @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.

  6. blvb commented on Dec 8, 2019

    @blvb

    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

  7. jancborchardt commented on Dec 9, 2019

    @jancborchardt
    Member

    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. :)

  8. E1k3 commented on Dec 9, 2019

    @E1k3

    @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 nextcloud/files_texteditor#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).

  9. shankari commented on Dec 15, 2019

    @shankari

    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.

  10. noe-spi commented on Dec 18, 2019

    @noe-spi
    Author

    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:

    • as MarkdownEditor builds on TextEditor (need TextEditor) why did the two groups do not know from each other and their dependencies? Especially if there is the decision to replace TextEditor with Text APP.

    • 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 express)

    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.

  11. noe-spi commented on Dec 18, 2019

    @noe-spi
    Author

    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?

  12. E1k3 commented on Dec 18, 2019

    @E1k3
    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.

  13. E1k3 commented on Dec 18, 2019

    @E1k3

    @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.

  14. shankari commented on Dec 18, 2019

    @shankari

    @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.

  15. 31 remaining items

  16. rollanders commented on May 5, 2020

    @rollanders

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

    image

  17. aschoerg commented on May 14, 2020

    @aschoerg

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

    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)

  18. shankari commented on Jun 20, 2020

    @shankari

    @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:

    • nextcloud: 17.0.1
    • markdown editor: 2.3.0
    • plain text editor: 2.11.0
    • Text app: 1.1.1

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

    Happy to upload logs if necessary.

  19. shankari commented on Jun 20, 2020

    @shankari

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

    • upgrade to nextcloud 19
    • ensure that the Markdown Editor is enabled and is at version 2.3.0
    • disable the Text app
    • now, if you click on any .md file file, it opens in the markdown editor which offers a split-screen with edit and preview panes

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

  20. binyamin commented on Dec 10, 2020

    @binyamin

    @juliushaertl After reading #323 (comment), 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 #323 (comment) 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.

  21. rollanders commented on Dec 11, 2020

    @rollanders

    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.

  22. changed the title [-]Plain text editing of markdown files[/-] [+]Text editor is always used as default editor for Markdown files no matter what other applications are installed[/+] on Mar 13, 2021
  23. nilsbecker commented on May 19, 2021

    @nilsbecker

    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.

  24. E1k3 commented on May 19, 2021

    @E1k3

    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.

  25. rollanders commented on May 19, 2021

    @rollanders

    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.

  26. szaimen commented on May 19, 2021

    @szaimen
    Contributor

    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?

  27. rollanders commented on May 19, 2021

    @rollanders

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

  28. rollanders commented on May 20, 2021

    @rollanders

    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

  29. E1k3 commented on May 20, 2021

    @E1k3

    I suggest you open a new issue regarding Text changing files without interaction.

    Side note: IMO having YAML inside markdown files is a questionable decision. Even more so when the markdown definition picocms refers to in their documentation does not permit comments (where YAML could be stored without breaking markdown syntax).

  30. unpinned this issue on Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions