aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test/Haddock
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-08-06 13:58:27 -0400
committerGitHub <noreply@github.com>2022-08-06 13:58:27 -0400
commite8fe591fecf626fe4540ed666d147c61728c890f (patch)
tree5a1a1d4d63c6315539a3606cc223b941f4c8620a /haddock-test/src/Test/Haddock
parent2f1711b301fea88eb1d0b40d1c04b2f0539fd882 (diff)
parent7f2892b571c7b072c86edbf21b7c7469e21f6303 (diff)
Merge pull request #1518 from bgamari/wip/ghc-9.4-merge
Merge GHC 9.4 into `main`
Diffstat (limited to 'haddock-test/src/Test/Haddock')
-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