aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-08-05 16:57:18 -0400
committerBen Gamari <ben@smart-cactus.org>2022-08-05 17:41:15 -0400
commitade67fe17e600738c815d7bcd6557a791e7aa1e1 (patch)
treeaffc0928f145f791c5b1de3db520e270f6a77754 /haddock-test/src/Test
parent2f1711b301fea88eb1d0b40d1c04b2f0539fd882 (diff)
parent7484cf883da0ececa8b9c0e039608d6c20654116 (diff)
Merge remote-tracking branch 'origin/ghc-9.4'
Diffstat (limited to 'haddock-test/src/Test')
-rw-r--r--haddock-test/src/Test/Haddock/Xhtml.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/haddock-test/src/Test/Haddock/Xhtml.hs b/haddock-test/src/Test/Haddock/Xhtml.hs
index bca2c4cc..74d8c4f7 100644
--- a/haddock-test/src/Test/Haddock/Xhtml.hs
+++ b/haddock-test/src/Test/Haddock/Xhtml.hs
@@ -23,8 +23,9 @@ import Data.Char ( isSpace )
newtype Xml = Xml { unXml :: String }
-- | Part of parsing involves dropping the @DOCTYPE@ line
+-- and windows newline endings
parseXml :: String -> Maybe Xml
-parseXml = Just . Xml . dropDocTypeLine
+parseXml = Just . Xml . filter (/= '\r') . dropDocTypeLine
where
dropDocTypeLine bs
| "<!DOCTYPE" `isPrefixOf` bs