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

EOL character weirdness #113

Closed
crystalfp opened this issue Mar 26, 2016 · 1 comment
Closed

EOL character weirdness #113

crystalfp opened this issue Mar 26, 2016 · 1 comment

Comments

@crystalfp
Copy link

I have a .md file with CRLF end of line, except one line that ends with a CR only. This line is followed by an empty line, that is CRLF only, to signal the paragraph end.
The file is here

The CR is interpreted as softbreak, that's OK (see also another lone CR at line 9) , but the parser don't see the following end of paragraph and joins the two paragraphs together.

Currently I call the parser with the following options: CMARK_OPT_NORMALIZE | CMARK_OPT_VALIDATE_UTF8 | CMARK_OPT_SMART
Seems this happens even if I add CMARK_OPT_HARDBREAKS or remove CMARK_OPT_NORMALIZE.

The spec says (pag. 4) that a CR alone is a valid line end, so I don't understand where the following CRLF is gone.

The fix is trivial, simply edit the file changing the guilty EOL, but who knows where in the heap of files lurks another lone CR?

This happens with the latest cmark 0.25.1 on Windows 7 64bits.

nwellnhof added a commit to nwellnhof/cmark that referenced this issue Mar 26, 2016
Now that cmark supports different line endings, files must be openend
in binary mode on Windows.

Fixes issue commonmark#113.
@jgm
Copy link
Member

jgm commented Mar 26, 2016

Closed by 03a6547

@jgm jgm closed this as completed Mar 26, 2016
nwellnhof added a commit to nwellnhof/cmark that referenced this issue Mar 27, 2016
Fixes EOLs when reading from stdin.

Fully fixes issue commonmark#113.
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

2 participants