Skip to content
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

Messed up entire markdown syntax #2577

Closed
vittorio-c opened this issue Jun 18, 2022 · 4 comments
Closed

Messed up entire markdown syntax #2577

vittorio-c opened this issue Jun 18, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@vittorio-c
Copy link

vittorio-c commented Jun 18, 2022

Describe the bug

The app messed up the entire markdown syntax of my file.

To Reproduce

Steps to reproduce the behavior:

  1. Create a markdown file in your regular markdown editor.
  2. Add normal stuff like lists, break lines, code fences, math expressions.
  3. Then open up your file in the "nextcloud/text" app and save the file.
  4. Open back your file in your regular markdown editor, and see errors : all your makrdown syntax is entirely messed up :
  • Backslash are added on every single math anotations.
  • Break lines are removed.
  • Lists '-' are replaced with '*'.
  • '<' and '>' in URL are simply... removed.
  • Langage indices (ex: 'python') in code fences are removed.

Is this normal behavior ? It sounds like the app is trying to avoid langage injection, or something like this. But I don't see why, since it's just regular file. There is no "excecution" capability in markdown file, isn't it ?

Expected behavior

None of my markdown syntax is touched.

Client details:

  • OS: Linux Manjaro 5
  • Browser: Firefox
  • Device: Desktop

Text app version: 3.5.1

Web server: Nextcloud 24

@vittorio-c vittorio-c added the bug Something isn't working label Jun 18, 2022
@vittorio-c vittorio-c changed the title YOUR APP IS TERRIBLE MESSED UP AN ENTIRE MARKDOWN FILE Jun 18, 2022
@vittorio-c vittorio-c changed the title MESSED UP AN ENTIRE MARKDOWN FILE Messed up entire markdown syntax Jun 19, 2022
@susnux
Copy link
Contributor

susnux commented Jun 21, 2022

Just as a user:

  • Backslash are added on every single math anotations.

  • Break lines are removed.

Sounds bad, probably a bug?

  • Lists '-' are replaced with '*'.

the text-app uses markdown-it to convert the markdown to html and, then tiptap to edit the html and prosemirror to recreate markdown.
So this is normal behavior as markdown-it parses it as a list and tiptap also recreates a markdown list, the previous style is simply not saved and the common mark specs say both are equal (tiptap preferes *).

  • '<' and '>' in URL are simply... removed.

But both characters are not even allowed within an URL.
So I would guess some of the used libraries simply validates the URL. See also rfc3986

  • Langage indices (ex: 'python') in code fences are removed.

That's also sound's like a bug, as markdown-it and tiptap should support those (covered by commonmark specs)

@XueSheng-GIT
Copy link

I assume this is related to #593

@juliusknorr
Copy link
Member

Since this ticket contains different separate topics, I'll close this and would ask you to open individual issues for each syntax problem together with a simple markdown example to reproduce.

Langage indices (ex: 'python') in code fences are removed.

I could reproduce this and opened #3328

'<' and '>' in URL are simply... removed.

I cannot reproduce this, so if you have an example file a separate issue would be highly appreciated.

Backslash are added on every single math anotations.
Break lines are removed.
Lists '-' are replaced with '*'.

Could you please open a separate issue with an example markdown file that shows specifically this issue?

@susnux
Copy link
Contributor

susnux commented Oct 28, 2022

Just for reference:

'<' and '>' in URL are simply... removed.

✔️ Should have been resolved with ProseMirror/prosemirror-markdown@48170d4

Backslash are added on every single math anotations.

✔️ Should have been resolved with #2704

Break lines are removed.

✔️ Was resolved by #2720

Lists '-' are replaced with '*'

❔ Still open, but hard to implement as both are semantically the same, this should not hurt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants