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 support #14

Closed
btrask opened this issue Mar 15, 2015 · 3 comments · Fixed by #18
Closed

CRLF support #14

btrask opened this issue Mar 15, 2015 · 3 comments · Fixed by #18

Comments

@btrask
Copy link
Contributor

btrask commented Mar 15, 2015

Thanks for your quick work on issue #11. I've continued integrating Cmark with my project.

I've found that when parsing files that use CRLF line endings with Cmark, block quotes extend into subsequent paragraphs, text after lists stays indented, and there are problems with fenced code.

I think the biggest problem is that the test cases don't seem to exercise alternate line endings at all. I'd suggest that all of the test cases should be automatically converted to each type of line ending (LF, CR, and CRLF) during make test and Cmark should be expected to pass all of them.

Perhaps there should also be some test cases for a single file brokenly mixing different line endings. This should be possible to handle reasonably intelligently.

I got CRLF support mostly working with some quick patches to blocks.c, which I can post if it would help. I didn't try digging into the tests.

@btrask
Copy link
Contributor Author

btrask commented Mar 15, 2015

I forgot to mention that commonmark.js seems to handle CRLFs correctly in every case I tested.

@jgm
Copy link
Member

jgm commented Mar 16, 2015

Yes, please do post your patches to blocks.c. And, good idea about the
testing.

+++ Ben Trask [Mar 15 15 16:53 ]:

Thanks for your quick work on issue #11. I've continued integrating Cmark with my project.

I've found that when parsing files that use CRLF line endings with Cmark, block quotes extend into subsequent paragraphs, text after lists stays indented, and there are problems with fenced code.

I think the biggest problem is that the test cases don't seem to exercise alternate line endings at all. I'd suggest that all of the test cases should be automatically converted to each type of line ending (LF, CR, and CRLF) during make test and Cmark should be expected to pass all of them.

Perhaps there should also be some test cases for a single file brokenly mixing different line endings. This should be possible to handle reasonably intelligently.

I got CRLF support mostly working with some quick patches to blocks.c, which I can post if it would help. I didn't try digging into the tests.


Reply to this email directly or view it on GitHub:
#14

@btrask
Copy link
Contributor Author

btrask commented Mar 20, 2015

Sorry for the delay, working on a more complete patch. Needs some changes to scanner.re too, not sure what else yet.

@btrask btrask mentioned this issue Mar 22, 2015
@jgm jgm closed this as completed in #18 Jun 3, 2015
PKRoma pushed a commit to PKRoma/cmark that referenced this issue Aug 19, 2018
* Add failing UTF-8 BOM test

* Add simple UTF-8 BOM skip

* Restrict BOM check to first line
mbernson pushed a commit to mbernson/cmark that referenced this issue Jul 6, 2020
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

Successfully merging a pull request may close this issue.

2 participants