aboutsummaryrefslogtreecommitdiff
path: root/haddock-test/src/Test
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-07-21 12:27:19 +1000
committerYuchen Pei <hi@ypei.me>2022-07-21 12:27:19 +1000
commit32ac0f03b4259fc8eebba9bb3a2a46d23122a43b (patch)
treea371fb9c5a3f78e6f53c66d70e1255fdc71bba4d /haddock-test/src/Test
parentcd17128898089450bb21790fd1864dc08fd4ddbc (diff)
parent2368e9329e6600b46000abd24ec00b7e27bcae75 (diff)
Merge remote-tracking branch 'upstream/ghc-9.4' into 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