aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-12-27 23:10:22 -0700
committerJohn MacFarlane <[email protected]>2025-12-27 23:10:22 -0700
commit6956176c193538cac65d1d404da0a05c8fc674c3 (patch)
treeaebb32be19005e892ddcc70441a6c024074c2d79 /src/Text
parentd52e40d17944a3abc7a8523b9f63e999526d082a (diff)
AsciiDoc writer: use doubled delims in more contexts.
Also escape the `#` character. Closes #11362. An alternative solution, raised in #11362, would be to rely less on escaping and simply always use doubled delimiters. However, there would still be a need for escaping, since one might use a literal `##` (for example)>
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index aca0a4241..55c3f724a 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -163,6 +163,7 @@ escapeString context t
needsEscape '+' = True
needsEscape '`' = True
needsEscape '*' = True
+ needsEscape '#' = True
needsEscape '_' = True
needsEscape '<' = True
needsEscape '>' = True
@@ -593,7 +594,9 @@ inlineListToAsciiDoc opts lst = do
_ -> False
isSpacy Start (Str xs)
| Just (c, _) <- T.uncons xs = isPunctuation c || isSpace c
- isSpacy _ _ = True
+ isSpacy End (Link{}) = True
+ isSpacy End (Image{}) = True
+ isSpacy _ _ = False
setIntraword :: PandocMonad m => Bool -> ADW m ()
setIntraword b = modify $ \st -> st{ intraword = b }