-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escaping of square brackets breaks links of embedded attachments for external Markdown Editor #4795
Comments
Thanks for the report. Can you tell how Obsidian renders this? Is it just a regular image element with a relative path to the image? |
Yes, this embedded attachment is put as separate file besides the markdown file and is rendered as image element. Of course, it would be brilliant if the NextCloud text editor could also render these ;) |
Kind of related to #1065 but while i commented back then I feel less hesitant to add those if we just cover them to preserve syntax for now. This would need a few steps though:
Most relevant spec for Obsidian is this one https://help.obsidian.md/Linking+notes+and+files/Embedding+files As a side note: I kind of like this syntax for "embedding files or links". This could also be interesting to separate a bit more between link previews and parts where people actually want to embed the file content (like a pdf that is rendered inline) - though that is probably something for a different discussion. |
@max-nextcloud @mejo- Any thoughts or objections on adding support for that syntax? |
No objections at all. I actually like the syntax and the distinction between embedded content and links. |
I noticed the same issue but for a different reason. Is it possible to disable the escaping of this character? Thanks! |
This is likely a different topic. We already support You can already create such links through the menu when marking existing text. |
I think there is something else goin on here.... What would be the explanation for this? My original text was |
Maybe some xss filter trying to do its sanitation? |
Is there any workaround anyone has found? Is there a way to get raw editing or hook into file save to run my own cleanup script or something? |
I used to use https://apps.nextcloud.com/apps/files_markdown. But it's a pita that NC decided to not allow to change the default away from texts. I've also got this issue if I just want to share a note for viewing. It gets open in the text app and is broken. Even if there is no support or exception for unsupported syntax, the app should not change the content if no input was made. |
I've ended up writing an Obsidian plugin to fix them. |
same for us with Logseq trilium, joplin, obsidian, logseq may work on the same documents - just not NC it's a pity to think of a plugin for each editor (as mentioned above) to work this problem around - as it's once again the users - people's work in other words - that is at stake instead of a technical response to teams' needs it seems to be a general state of things at this erea: i work in state schools in France, students and teachers are highly limited in their work because of IT services decisions and processes - it seems that 'work' and ´usage' come after the ´tool' and its conception - i think its a break down to our investment in working with computers .. good luck to everyone to build a better future for the collaboration of our human organisations 🙏✌️ |
This originates from https://github.com/ProseMirror/prosemirror-markdown/blob/e59521463f62b296cc072962aa2d60b267ea4397/src/to_markdown.ts#L432-L443 I don't see a quick and easy way to adjust escaping directly |
This comment has been minimized.
This comment has been minimized.
Well, can't you do this yet? by choosing the option of the action to perform when file is opened in Collectives: view or edit? |
As soon as I click on it it opens in the the editor and is broken 😕 |
@janLo then you might have to think of a different way to publish your notes, and view them or edit them on line. Have you had to disable wikilinks in Obsidian? aren't the wikilinks preserved by the NC editor? |
No solution to this? |
not on my side :/ |
Short summary of the issue
I'm using an external Markdown Editor (Obsidian) and sync the files via the NextCloud Desktop Client to the server. When saving a markdown file with the NextCloud text editor in the web interface, the links for embedded attachements are broken, because the square brackets are escaped with a backslash. Can this escaping for square brackets (or other chars) manually turned off?
Example markdown content
Resulting markdown content after saving
Screenshot of the rendering in text
Details
The text was updated successfully, but these errors were encountered: