git.iko.soy/typeable/pandoc
on master help sign in
Asciidoc writer: use doubled ## when necessary for spans.

Closes #5566.

commit59529e408b87274fb8e0375fa198a6636cb67a11 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 10 Jun 2019, 14:47 (7 years ago) parent2e12106
2 files changed+9−1
src/Text/Pandoc/Writers/AsciiDoc.hs+3−1 test/command/5566.md+6
src/Text/Pandoc/Writers/AsciiDoc.hs+3−1
@@ -520,9 +520,11 @@ inlineToAsciiDoc opts (Note [Plain inlines]) = do
520520inlineToAsciiDoc _ (Note _) = return "[multiblock footnote omitted]"
521521inlineToAsciiDoc opts (Span (ident,classes,_) ils) = do
522522 contents <- inlineListToAsciiDoc opts ils
523+ isIntraword <- gets intraword
524+ let marker = if isIntraword then "##" else "#"
523525 if null ident && null classes
524526 then return contents
525527 else do
526528 let modifier = brackets $ text $ unwords $
527529 [ '#':ident | not (null ident)] ++ map ('.':) classes
528− return $ modifier <> "#" <> contents <> "#"
530+ return $ modifier <> marker <> contents <> marker
test/command/5566.mdnew file+6
@@ -0,0 +1,6 @@
1+```
2+% pandoc -t asciidoc -f html
3+fo<span class="c">o</span> f<span class="c">o</span>o <span class="c">f</span>oo <span class="c">foo</span>
4+^D
5+fo[.c]##o## f[.c]##o##o [.c]##f##oo [.c]#foo#
6+```