diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-09-05 13:46:44 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-09-05 13:46:44 -0700 |
commit | bc5624dac2da7674f42838db8672520e8949c9db (patch) | |
tree | 088f89d317c5185226676d199b2315923d513475 /src/Text | |
parent | d62c4a92470de3b0aa73ddb3fe921a1f9b154b41 (diff) |
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.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 7 |
1 files changed, 3 insertions, 4 deletions
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 "</span>" |