Markdown writer: Use bracketed form for native spans...
...when `bracketed_spans` enabled. Closes #3229.
This commit is contained in:
parent
20b2269fb7
commit
31076adf09
1 changed files with 11 additions and 4 deletions
|
@ -858,10 +858,17 @@ inlineToMarkdown :: WriterOptions -> Inline -> MD Doc
|
||||||
inlineToMarkdown opts (Span attrs ils) = do
|
inlineToMarkdown opts (Span attrs ils) = do
|
||||||
plain <- asks envPlain
|
plain <- asks envPlain
|
||||||
contents <- inlineListToMarkdown opts ils
|
contents <- inlineListToMarkdown opts ils
|
||||||
return $ if not plain &&
|
return $ case plain of
|
||||||
(isEnabled Ext_raw_html opts || isEnabled Ext_native_spans opts)
|
True -> contents
|
||||||
then tagWithAttrs "span" attrs <> contents <> text "</span>"
|
False | isEnabled Ext_bracketed_spans opts ->
|
||||||
else contents
|
"[" <> contents <> "]" <>
|
||||||
|
if attrs == nullAttr
|
||||||
|
then "{}"
|
||||||
|
else linkAttributes opts attrs
|
||||||
|
| isEnabled Ext_raw_html opts ||
|
||||||
|
isEnabled Ext_native_spans opts ->
|
||||||
|
tagWithAttrs "span" attrs <> contents <> text "</span>"
|
||||||
|
| otherwise -> contents
|
||||||
inlineToMarkdown opts (Emph lst) = do
|
inlineToMarkdown opts (Emph lst) = do
|
||||||
plain <- asks envPlain
|
plain <- asks envPlain
|
||||||
contents <- inlineListToMarkdown opts lst
|
contents <- inlineListToMarkdown opts lst
|
||||||
|
|
Loading…
Add table
Reference in a new issue