From 137620c7cdf36b5ad0da20851d258e9b2d034e5c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 6 Jul 2023 14:15:38 -0700 Subject: Typst reader: filter out CR in raw. --- src/Text/Pandoc/Readers/Typst.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/Typst.hs b/src/Text/Pandoc/Readers/Typst.hs index 7ac459fbd..b11414414 100644 --- a/src/Text/Pandoc/Readers/Typst.hs +++ b/src/Text/Pandoc/Readers/Typst.hs @@ -217,7 +217,7 @@ blockHandlers = M.fromList children) ,("terms.item", \_ fields -> getField "body" fields >>= pWithContents pBlocks) ,("raw", \mbident fields -> do - txt <- getField "text" fields + txt <- T.filter (/= '\r') <$> getField "text" fields mblang <- getField "lang" fields let attr = (fromMaybe "" mbident, maybe [] (\l -> [l]) mblang, []) pure $ B.codeBlockWith attr txt) @@ -387,7 +387,7 @@ inlineHandlers = M.fromList case mbweight of Just "bold" -> B.strong <$> pWithContents pInlines body _ -> pWithContents pInlines body) - ,("raw", \_ fields -> B.code <$> getField "text" fields) + ,("raw", \_ fields -> B.code . T.filter (/= '\r') <$> getField "text" fields) ,("footnote", \_ fields -> B.note <$> (getField "body" fields >>= pWithContents pBlocks)) ,("cite", \_ fields -> do -- cgit v1.2.3