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

Markdown test fails with windows line endings in test file #10833

Closed
ihnorton opened this issue Apr 15, 2015 · 7 comments · Fixed by #14073
Closed

Markdown test fails with windows line endings in test file #10833

ihnorton opened this issue Apr 15, 2015 · 7 comments · Fixed by #14073
Labels
bug Indicates an unexpected problem or unintended behavior docsystem The documentation building system system:windows Affects only Windows

Comments

@ihnorton
Copy link
Member

unix2dos test/markdown.jl breaks the markdown test. This will be a problem for Windows people using editors that follow the platform convention, so we should try to be agnostic.

cc @one-more-minute @hayd

@ihnorton ihnorton added bug Indicates an unexpected problem or unintended behavior docs This change adds or pertains to documentation system:windows Affects only Windows labels Apr 15, 2015
@hayd
Copy link
Member

hayd commented Apr 15, 2015

MD equality compares the html output, only one side includes \r\n here.

Note: Markdown.parse("\r\n #\r\n empty\r\n ") breaks terminal rendering, so I think this does need to be dealt with as if they are \n.

@MikeInnes
Copy link
Member

Would it be enough to just strip out \rs completely? I imagine the spec has a lot to say about this kind of thing.

@hayd
Copy link
Member

hayd commented Apr 15, 2015

The spec says '\r' is a whitespace character (which we do, although we're missing \n and form feed) but (link):

A line ending is, depending on the platform, a newline (U+000A), carriage return (U+000D), or carriage return + newline.

I dislike the "depending on platform", to me it's reasonable to want all of these work (the same) regardless of platform.

This means you can't just strip the \rs!

Adding a util to eatnewline (to look for \r, \n and \r\n, and maybe eat it) shouldn't be that awkward a solution.... I'm not sure how invasive that will be in parsing logic. Will look into it.


Aside: readline doesn't work with just \r (unclear if that is a bug, or if it's "depending on platform"! :s).

@StefanKarpinski
Copy link
Member

I agree that this shouldn't be platform dependent.

@hayd
Copy link
Member

hayd commented Apr 16, 2015

http://blog.codinghorror.com/the-great-newline-schism/

Had a little go, amusingly (asI mentioned it)... the annoying part, which makes this more complicated, does turn out to be that readline doesn't accept \r as a line ending! :s

@hayd
Copy link
Member

hayd commented May 29, 2015

Could the markdown text just go through a simple regex pass first:

replace(..., r"\r(\n)?", '\n')

@quinnj quinnj added docsystem The documentation building system and removed docs This change adds or pertains to documentation labels Jun 28, 2015
@ihnorton
Copy link
Member Author

related to #11988.

tkelman added a commit that referenced this issue Jun 4, 2016
similar to #10833, only happens with windows line endings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior docsystem The documentation building system system:windows Affects only Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants