text icon indicating copy to clipboard operation
text copied to clipboard

Nextcloud editor mangling reference links

Open cosmiczoo opened this issue 11 months ago • 4 comments

Short summary of the issue

Nextcloud markdown editor quietly changes links in markdown file containing links in the format [[Name of a page]] to [[Name of a page[[

  • [ ] Markdown syntax is not properly rendered in text
  • [ ] Markdown syntax is removed after closing text
  • [x] Markdown syntax is changed after closing text
  • [ ] Something else: Please describe more in detail

Example markdown file

Open a markdown file created in Nextcloud say New text file.md Contents of file:

This is some text and here is a [[Link to another page]] in Logseq's markdown dialect.

Open in Nextcloud Markdown editor. The [[ ... ]] references look unchanged in Nextdown editor. Make no changes to the file. Close the file.

Resulting markdown file New text file.md after opening in text

This is some text and here is a \[\[Link to another page\]\] in Logseq's markdown dialect.

Screenshot of the rendering in text

Picture of New Text file.md opened in kWrite

Picture of same file opened in Nextcloud web editor

Details

  • Nextcloud version: 30.0.4
  • Ubuntu Server
$ snap list nextcloud
Name       Version      Rev    Tracking       Publisher   Notes
nextcloud  30.0.4snap1  45728  latest/stable  nextcloud✓  -

Preferred solution alternatives

  1. If the syntax is not in the Nextcloud Markdown dialect, make the editor pass through the unsupported text unmodified
  2. If the file is not edited but only read, do not change the file or reinstate the file.
  3. Plug in a suitable alternative markdown editor that is tolerant of foreign markdown.

cosmiczoo avatar Jan 20 '25 10:01 cosmiczoo

Thanks a lot for reporting this and providing all relevant information. @max-nextcloud Do you see any quick way to solve that? Maybe that is an interesting ticket to pair with @JuliaKirschenheuter on text markdown handling and internals.

The syntax is quite common I think so worth to spent some time looking into that I'd say.

juliusknorr avatar Jan 20 '25 11:01 juliusknorr

Obsidian uses the [[Link]] syntax as well, so editing Obsidian files on Nextcloud also renders any links unusable. I would be really glad to see this resolved, because the Text app looks fantastic otherwise!

klimpner avatar Jan 22 '25 09:01 klimpner

I just tried to reproduce this and failed. Are you sure this also happens when making no changes to the file? I would expect nothing to be saved in that case.

Which version of Nextcloud are you using? I'm pretty sure we fixed saving of unchanged docs quite a while ago. Could you provide a file that would be changed by Nextcloud if uploaded and viewed?

I agree we should support the syntax and ideally preserve it if changes are made to the file elsewhere. So from my point of view there are two things at play here. In order to preserve the links we'd probably need a markdown-it extension that parses them into html that we can clearly distinguish from other links.

max-nextcloud avatar May 23 '25 11:05 max-nextcloud

Also related https://github.com/nextcloud/text/issues/4795

juliusknorr avatar Jun 10 '25 13:06 juliusknorr