Asciidoc writer: use doubled ## when necessary for spans.
Closes #5566.
This commit is contained in:
parent
2e12106a90
commit
59529e408b
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
6
test/command/5566.md
Normal file
6
test/command/5566.md
Normal file
|
@ -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#
|
||||
```
|
Loading…
Reference in a new issue