Skip to content

Messed up entire markdown syntax #2577

Closed

Description

@vittorio-c

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

Activity

  1. added
    bug
    on Jun 18, 2022
  2. changed the title [-]YOUR APP IS TERRIBLE[/-] [+]MESSED UP AN ENTIRE MARKDOWN FILE[/+] on Jun 18, 2022
  3. changed the title [-]MESSED UP AN ENTIRE MARKDOWN FILE[/-] [+]Messed up entire markdown syntax[/+] on Jun 19, 2022
  4. susnux commented on Jun 21, 2022

    @susnux
    Contributor

    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)

  5. XueSheng-GIT commented on Jun 21, 2022

    @XueSheng-GIT

    I assume this is related to #593

  6. juliusknorr commented on Oct 28, 2022

    @juliusknorr
    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?

  7. susnux commented on Oct 28, 2022

    @susnux
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions