git.iko.soy/typeable/pandoc
on master help sign in
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.

commitbc5624dac2da7674f42838db8672520e8949c9db authorJohn MacFarlane <jgm@berkeley.edu> dateTue 5 Sep 2017, 13:46 (9 years ago) parentd62c4a9
1 file changed+3−4
src/Text/Pandoc/Writers/Markdown.hs+3−4
src/Text/Pandoc/Writers/Markdown.hs+3−4
@@ -949,11 +949,10 @@ inlineToMarkdown opts (Span attrs ils) = do
949949 contents <- inlineListToMarkdown opts ils
950950 return $ case plain of
951951 True -> contents
952− False | isEnabled Ext_bracketed_spans opts ->
952+ False | attrs == nullAttr -> contents
953+ | isEnabled Ext_bracketed_spans opts ->
953954 "[" <> contents <> "]" <>
954− if attrs == nullAttr
955− then "{}"
956− else linkAttributes opts attrs
955+ linkAttributes opts attrs
957956 | isEnabled Ext_raw_html opts ||
958957 isEnabled Ext_native_spans opts ->
959958 tagWithAttrs "span" attrs <> contents <> text "</span>"