Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006340OCamlOCamldocpublic2014-03-06 16:402015-03-25 02:16
Assigned Todoligez 
PlatformOSOS Version
Product Version4.01.0 
Target Version4.02.2+dev / +rc1Fixed in Version4.03.0+dev 
Summary0006340: Incorrect handling of \r when processing "Windows" source files
Descriptionocamldoc 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 ReproduceCreate Broken.mli (using Windows line-endings) and run ocamldoc -html -stars Broken.mli

 * This will be broken by ocamldoc.
 * It seems unable to cope with DOS line endings.
 * {[let foo = "bar"
 * "fu" ^ foo]}

val foo : unit
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2014-09-15 09:55

Arguably, your HTML renderer is also broken: it shouldn't take a single \r as an end-of-line.
dra (reporter)
2014-09-15 11:10
edited on: 2014-09-15 11:10

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.
Technically ( [^]), both are behaving correctly - \r\r\n is two line breaks (or three, depending on how you read it!) and a pre element's rendering of whitespace is all covered by "may"! What SGML parsing has to say about mixed line break use, I don't know, because it's of course an ISO standard and I'm not wealthy enough to be able to consult it!

doligez (administrator)
2015-02-06 21:19

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.
doligez (administrator)
2015-03-25 02:16

tested under Windows

- Issue History
Date Modified Username Field Change
2014-03-06 16:40 dra New Issue
2014-03-06 16:40 dra Status new => assigned
2014-03-06 16:40 dra Assigned To => guesdon
2014-07-16 18:25 doligez Target Version => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-15 09:55 doligez Note Added: 0012129
2014-09-15 09:55 doligez Target Version undecided => 4.02.2+dev / +rc1
2014-09-15 11:10 dra Note Added: 0012133
2014-09-15 11:10 dra Note Edited: 0012133 View Revisions
2015-02-06 21:19 doligez Note Added: 0013248
2015-02-06 21:20 doligez Assigned To guesdon => doligez
2015-02-06 21:20 doligez Fixed in Version => 4.03.0+dev
2015-03-25 02:16 doligez Note Added: 0013540
2015-03-25 02:16 doligez Status assigned => closed
2015-03-25 02:16 doligez Resolution open => fixed

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker