Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Incorrect handling of \r when processing "Windows" source files #6340
Original bug ID: 6340
ocamldoc doesn't correctly handle Windows line endings (\r\n) in comments - resulting HTML files contain \r\r\n. This shows up in code blocks as spurious blank lines.
Steps to reproduce
Create Broken.mli (using Windows line-endings) and run ocamldoc -html -stars Broken.mli
val foo : unit
Comment author: @dra27
Well, possibly, but by HTML renderer you're referring to Internet Explorer 11, Chrome 37 and Firefox 27 (I know that's out-of-date - I don't use it very often!). Interestingly, as I also have a not-updated Ubuntu 12.4 virtual machine, Firefox 27 appears to ignore the extra \r on Linux, but not on Windows.
Comment author: @damiendoligez
OK, so it's HTML itself that is broken. I'm not surprised.
FTR, now that MacOS 9 has disappeared, the correct way to handle this CR/LF nonsense is to consider that LF is a newline, and CR is utterly ignored in all contexts. That works with both Unix and Windows.
I've committed a fix to trunk (rev 15815), but I still need to test it for real under Windows.