aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-06-10 14:47:04 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-06-10 14:47:04 -0700
commit59529e408b87274fb8e0375fa198a6636cb67a11 (patch)
tree3c5e092d258b75932710ed90a5cc451e8df3f6ab /src/Text
parent2e12106a901cf2574a7ef50975e71be13d02fca9 (diff)
downloadpandoc-59529e408b87274fb8e0375fa198a6636cb67a11.tar.gz
Asciidoc writer: use doubled ## when necessary for spans.
Closes #5566.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index cf5fec86f..460cce3ae 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -520,9 +520,11 @@ inlineToAsciiDoc opts (Note [Plain inlines]) = do
inlineToAsciiDoc _ (Note _) = return "[multiblock footnote omitted]"
inlineToAsciiDoc opts (Span (ident,classes,_) ils) = do
contents <- inlineListToAsciiDoc opts ils
+ isIntraword <- gets intraword
+ let marker = if isIntraword then "##" else "#"
if null ident && null classes
then return contents
else do
let modifier = brackets $ text $ unwords $
[ '#':ident | not (null ident)] ++ map ('.':) classes
- return $ modifier <> "#" <> contents <> "#"
+ return $ modifier <> marker <> contents <> marker