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

Surprisingly, line endings vary by OS.. #2097

Closed
pombreda opened this issue Apr 20, 2015 · 9 comments
Closed

Surprisingly, line endings vary by OS.. #2097

pombreda opened this issue Apr 20, 2015 · 9 comments

Comments

@pombreda
Copy link
Contributor

When I run Pandoc on the same text on Linux and Windows, the Windows output will have CR/LF and the Linux one will have LF line endings. This is rather annoying, I would expect either to:

  • always have an LF output on all OS,
  • be able to select and force a line ending with a command line option,
  • have the original line ending of the input file preserved and not damaged to CRLF.
@jgm
Copy link
Owner

jgm commented Apr 20, 2015

I expect that many Windows users prefer the current behavior. But it would be interesting to find out. I suggest that you raise this as a discussion item on pandoc-discuss, and once you get some feedback there, it may be appropriate to move to a more determinate suggestion on this tracker.

It would also be helpful to know what version of pandoc you are using, and what ouput format(s) you are noticing this in.

@pombreda
Copy link
Contributor Author

@jgm I will post on the list... being a multi-OS developer, anything that changes the line endings of an input file is a source of annoyance. But the thing that is the most annoying is to have a behavior that varies on each OS... giving inconsistent results. I use the prebuilt binaries you provide for 1.13.2 . Most of the conversions are from anything to plain . I use pandoc to decruft any markup to plain text.

@erichiller
Copy link

@pombreda it took me ages to figures the simplest of things -- line endings. I am in agreement with you, it would be nice to have the ability to have uniformity in line endings across systems. I am currently running everything through dos2unix but I wish that wasn't required.

@legends2k
Copy link

I agree that allowing the user to override the default EOL character would be a useful option.

@tajmone
Copy link
Contributor

tajmone commented May 12, 2017

I've made a formal feature request: #3663.

@tajmone
Copy link
Contributor

tajmone commented May 14, 2017

I have a question:

I'm writing a custom tool to normalize all EOLs to LF. It will convert all CRLF occurences to LF. I've also implemented conversion of CR to LF, to be on the safe line (CR is often mentioned as Mac-style EOL) — but if this last operation is not needed I could omit it and gain some speed in my toolchain.

Are there any real chances that in some OSs' pandoc will use CR as EOL character? (I'm not aware of all the OSs' pandoc runs in)

@jgm
Copy link
Owner

jgm commented May 15, 2017 via email

@pombredanne
Copy link

it is unlikely to happen these days... MacOS 9.x-only text files are something that I never in many years

@Drezil
Copy link
Contributor

Drezil commented May 17, 2017

I implemented a flag to force the line-endings in output in a PR:
#3680

@jgm jgm closed this as completed in 6b8240f May 18, 2017
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

7 participants