aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-07-25 09:18:22 -0600
committerJohn MacFarlane <[email protected]>2023-07-25 09:23:16 -0600
commit77e01242da8ab64af52a75459d42dc230282647a (patch)
tree3769ee15e6015d1d3d9d984e2ff49e32fdd0b2ac /src
parentc06b9ab33147cea8363961929dedbd97f754e5dc (diff)
Typst writer: escape `//`.
So it doesn't get interpreted as a comment. Closes #8966.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Typst.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs
index a844865aa..53edbcb0c 100644
--- a/src/Text/Pandoc/Writers/Typst.hs
+++ b/src/Text/Pandoc/Writers/Typst.hs
@@ -290,6 +290,7 @@ textstyle s inlines = (s <>) . brackets <$> inlinesToTypst inlines
escapeTypst :: EscapeContext -> Text -> Text
escapeTypst context t =
+ T.replace "//" "\\/\\/" $
if T.any needsEscape t
then T.concatMap escapeChar t
else t