Markdown writer: make Span with null attribute transparent.

That is, we don't use brackets or `<span>` tags to mark
spans when there are no attributes; we simply output the
contents.
This commit is contained in:
John MacFarlane
2017-09-05 13:46:44 -07:00
parent d62c4a9247
commit bc5624dac2
+3 -4
View File
@@ -949,11 +949,10 @@ inlineToMarkdown opts (Span attrs ils) = do
contents <- inlineListToMarkdown opts ils
return $ case plain of
True -> contents
False | isEnabled Ext_bracketed_spans opts ->
False | attrs == nullAttr -> contents
| isEnabled Ext_bracketed_spans opts ->
"[" <> contents <> "]" <>
if attrs == nullAttr
then "{}"
else linkAttributes opts attrs
linkAttributes opts attrs
| isEnabled Ext_raw_html opts ||
isEnabled Ext_native_spans opts ->
tagWithAttrs "span" attrs <> contents <> text "</span>"