diff options
| author | John MacFarlane <[email protected]> | 2023-07-06 14:15:38 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-07-06 14:15:38 -0700 |
| commit | 137620c7cdf36b5ad0da20851d258e9b2d034e5c (patch) | |
| tree | f51581e66549548ace3d83a229f59dd65a30d91c | |
| parent | a2be4ac62bfd95ce8007af0de925a675bd782fa2 (diff) | |
Typst reader: filter out CR in raw.
| -rw-r--r-- | src/Text/Pandoc/Readers/Typst.hs | 4 |
1 files 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 |
