aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs4
-rw-r--r--test/command/5566.md6
2 files changed, 9 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
diff --git a/test/command/5566.md b/test/command/5566.md
new file mode 100644
index 000000000..356a5468a
--- /dev/null
+++ b/test/command/5566.md
@@ -0,0 +1,6 @@
+```
+% pandoc -t asciidoc -f html
+fo<span class="c">o</span> f<span class="c">o</span>o <span class="c">f</span>oo <span class="c">foo</span>
+^D
+fo[.c]##o## f[.c]##o##o [.c]##f##oo [.c]#foo#
+```