Non-compliant markdown rendering for line breaks (OD-1117)
Unknown opened 3 years ago

The current markdown parsing is not compliant with the standard, when rendering the README.md on my projects, I have realised that line breaks are rendered in Onedev, when they shouldn't

Hello 
world

Should be rendered as Hello world

Hello

world

Should be rendered as:

Hello

world

But currently the first is rendered as the second, which is not compliant with markdown, you should have a blank line to indicate new lines, markdown supports line wrapping, which allows for long paragraphs to be split across many lines without breaking up the content, currently onedev splits up the content when it is split onto multiple lines.

  • Robin Shen commented 3 years ago

    OneDev uses flexmark (https://github.com/vsch/flexmark-java) to render markdown. And it is intentionally to break line in this case in recent versions (advertise as a change). I guess they have a reason to do this, and also personally I find it to be more convenient.

  • Unknown commented 3 years ago

    More convienient how? It breaks up the markdown file which forces people to put everything on a single line to prevent it being separated out, this makes markdown harder to maintain. Some text editors like vscode do automatically wrap it to the next line without inserting a newline character, which means this wouldn't break markdown, but as I use neovim, it can be hard navigating and also modifying markdown when wrapped, and new lining it will cause it to separate into different paragraphs.

    Thus, this is a large pain!


  • Robin Shen commented 3 years ago

    It works the same way as in email or other text editors. I guess user not familiar with markdown will feel strange if their intentionally breaked lines are rendered as a single whole line.

  • Unknown commented 3 years ago

    This breaks conventions though: https://www.markdownguide.org/basic-syntax/#paragraphs-1

    Markdown clearly supports this and then flexmark decides to go and break convention? This is like me coming along to a protocol and thinking screw this I am going to ignore the specification and implement whatever I like!

    This severely angers me how the flexmark developers come along and just break from convention, if you are going to wrap a format, YOU FOLLOW THE CONVENTION!

    I guess this is not something I should be discussing here as it was not you which made the change, I guess this is a discussion I should have over on flexmarks github (I doubt they will reply though, they do not seem to be the most active).


  • Unknown commented 3 years ago

    If you require more proof, here is more documentation from another source: https://daringfireball.net/projects/markdown/syntax#p


  • Robin Shen commented 3 years ago

    They might have some options to tweak the behavior. Haven't checked that though.

  • Robin Shen commented 3 years ago

    I know this is not standard.

  • Unknown commented 3 years ago

    This behaviour being default is a big enough issue alone, you should always follow conventions, when you break from conventions you cause major disruption within the programming community.

    I am aware you like this behaviour, so it is not terrible for you, but it is a pain in the a** for me!


  • Unknown commented 3 years ago

    Wait, you mentioned emails as well. You use the same standard for parsing text based emails, because again that is unconventional. Text based emails use single line breaks to be able to easier to write instead of having long lines, and then it can be mapped to the size of the screen (thunderbird handles this functionality very well).


  • Robin Shen commented 3 years ago

    Text based emails of course are not parsed with markdown parser.

  • Unknown commented 3 years ago

    I mean not with the markdown parser, I mean the text based emails parsed in the same way, by including newlines which are added to allow text based emails to be easier to write.

    Obviously you wouldn't use a markdown parser to parse a text based email xD


  • Robin Shen changed fields 3 years ago
    Name Previous Value Current Value
    Type
    Improvement
    Bug
    Seen Builds
    empty
    5715
  • Robin Shen commented 3 years ago

    Turns out that flexmark default is comforming to markdown standard on this regard. I added an option to alter its behavior for my convenience. Since this does not conform to standard, I will remove this option in next patch release.

  • Robin Shen changed title 3 years ago
    Previous Value Current Value
    Non-compliant markdown rendering
    Non-compliant markdown rendering for line breaks
  • Unknown commented 3 years ago

    Thanks Robin :)


  • OneDev changed state to 'Closed' 3 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev commented 3 years ago

    State changed as code fixing the issue is committed

  • OneDev changed state to 'Released' 3 years ago
    Previous Value Current Value
    Closed
    Released
  • OneDev commented 3 years ago

    State changed as build #3293 is successful

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
Not Found
Issue Votes (0)
Watchers (3)
Reference
OD-1117
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover