From bc5624dac2da7674f42838db8672520e8949c9db Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 5 Sep 2017 13:46:44 -0700 Subject: Markdown writer: make Span with null attribute transparent. That is, we don't use brackets or `` tags to mark spans when there are no attributes; we simply output the contents. --- src/Text/Pandoc/Writers/Markdown.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 9d6064af6..3dbfe3f11 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -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 "" -- cgit v1.2.3