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

CRLF line endings are not parsed correctly. #49

Open
ajalt opened this issue Oct 14, 2020 · 3 comments
Open

CRLF line endings are not parsed correctly. #49

ajalt opened this issue Oct 14, 2020 · 3 comments

Comments

@ajalt
Copy link
Contributor

ajalt commented Oct 14, 2020

The CommmonMark spec requires CR and CRLF to be supported as line endings, but this library parses CRLF incorrectly. For example:

MarkdownParser(CommonMarkFlavourDescriptor()).buildMarkdownTreeFromString("a \r\nb")

parses as:

Markdown:PARAGRAPH
  Markdown:TEXT 'a'
  Markdown:BR '·␍'
  Markdown:EOL '␊'
  Markdown:TEXT 'b'

and renders as:

<body><p>a<br />
b</p></body>
@altavir
Copy link

altavir commented Apr 30, 2022

Got the same problem. Because of this, paragraphs are parsed incorretly on Windows.

@SPC-code
Copy link

SPC-code commented Jan 9, 2023

Could you please fix this? We use the library in https://github.com/SciProgCentre/snark site byuilder and incorrect render of Markdown produced on Windows is annoying.

@tjpalmer
Copy link

This is a huge failing of this library today. I can search and replace line endings in advance, but then the need to map source ranges back becomes a huge bother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants