diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-08-25 18:40:53 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-08-25 18:41:29 -0700 |
| commit | 7de54891cb1a5aa5b5bd242d3059b0d8e603a9b1 (patch) | |
| tree | bb62235cf905557a0c528dade30eedb064673a06 /src/Text | |
| parent | 42fe4d2e50cd0e731d6ab58a69c1bea5a2fc5ed6 (diff) | |
HTML writer: only add role attribute in HTML5.
It is not valid in HTML4.
See #8241.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index cdbf11e1e..f794e624a 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1613,7 +1613,10 @@ inlineToHtml opts inline = do _ | html5 -> link ! H5.customAttribute "role" "doc-noteref" _ -> link - (Cite cits il)-> do contents <- inlineListToHtml opts (walk addRoleToLink il) + (Cite cits il)-> do contents <- inlineListToHtml opts + (if html5 + then walk addRoleToLink il + else il) let citationIds = T.unwords $ map citationId cits let result = H.span ! A.class_ "citation" $ contents return $ if html5 |
