Ticket #57 (closed defect: fixed)
haddock doubles ^Ms
| Reported by: | igloo | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Version: | Keywords: | ||
| Cc: | ndmitchell@… |
Description
Originally reported here: http://www.haskell.org/pipermail/cvs-ghc/2008-August/044392.html by Neil Mitchell.
We can skip the CPP part from his report if we start with this Foo.hs:
^M module Foo where^M ^M -- | > test a^M test :: a^M test = undefined^M
(CPP in Neil's message just ensures that there are ^Ms in the file)
Then running
haddock.exe --hoogle Foo
gives us a main.txt containing
-- Hoogle documentation, generated by Haddock^M -- See Hoogle, http://www.haskell.org/hoogle/^M ^M @package main^M ^M module Foo^M ^M -- | <pre>^M -- test a^M^M -- </pre>^M test :: a^M
Note the double ^M.
I suspect that this happens because the file is read with something like lines (which leaves the ^M in the string) and then written with something like hPutStrLn (which appends ^M\n to the string). I don't know exactly which lines or hPutStrLn, but I think they're more likely to be in haddock than GHC, so I'm filing the bug here.
