aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
diff options
context:
space:
mode:
authorFlorian Beeres <yuuki@protonmail.com>2019-11-11 17:55:58 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-11 08:55:58 -0800
commitbf2eb4f288df5d5b5e054cdc4ffa3b3c4dd187fa (patch)
treef49ab82d214ec4bd4badf8e67d89362d8c70a10a /src/Text/Pandoc/Writers/HTML.hs
parent3bf53628984a91d9456d40b1202e9d15f1ad3088 (diff)
downloadpandoc-bf2eb4f288df5d5b5e054cdc4ffa3b3c4dd187fa.tar.gz
Change the implementation of `htmlSpanLikeElements` and implement `<dfn>` (#5882)
* Add HTML Reader support for `<dfn>`, parsing this as a Span with class `dfn`. * Change `htmlSpanLikeElements` implementation to retain classes, attributes and inline content.
Diffstat (limited to 'src/Text/Pandoc/Writers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 3971b7740..f042bda21 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -998,13 +998,15 @@ inlineToHtml opts inline = do
(Span (id',classes,kvs) ils) ->
let spanLikeTag = case classes of
- [c] -> do
+ (c:_) -> do
let c' = T.pack c
guard (c' `Set.member` htmlSpanLikeElements)
pure $ customParent (textTag c')
_ -> Nothing
in case spanLikeTag of
- Just tag -> tag <$> inlineListToHtml opts ils
+ Just tag -> do
+ h <- inlineListToHtml opts ils
+ addAttrs opts (id',tail classes',kvs') $ tag h
Nothing -> do
h <- inlineListToHtml opts ils
addAttrs opts (id',classes',kvs') (H.span h)