diff options
author | Andy Morris <hello@andy-morris.xyz> | 2020-10-30 15:22:46 +0100 |
---|---|---|
committer | Albert Krewinkel <albert+github@zeitkraut.de> | 2020-10-30 16:38:59 +0100 |
commit | f1f2728259ca0258a9870028a5c05b5973efdc20 (patch) | |
tree | 63ae4d790ae4f1d35f2f20189a349d22517eabc0 /src/Text | |
parent | 3e6d009c6b33f25dea2ff1cb13298dfa3ec0bddd (diff) | |
download | pandoc-f1f2728259ca0258a9870028a5c05b5973efdc20.tar.gz |
Fix duplicate "class" attribute in HTML writer
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index b6bde7f8f..bac720c66 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1089,16 +1089,18 @@ tableRowToHtml :: PandocMonad m -> TableRow -> StateT WriterState m Html tableRowToHtml opts (TableRow tblpart attr rownum rowhead rowbody) = do - let rowclass = A.class_ $ case rownum of + let rowclass = case rownum of Ann.RowNumber x | x `rem` 2 == 1 -> "odd" _ | tblpart /= Thead -> "even" _ -> "header" + let attr' = case attr of + (id', classes, rest) -> (id', rowclass:classes, rest) let celltype = case tblpart of Thead -> HeaderCell _ -> BodyCell headcells <- mapM (cellToHtml opts HeaderCell) rowhead bodycells <- mapM (cellToHtml opts celltype) rowbody - rowHtml <- addAttrs opts attr $ H.tr ! rowclass $ do + rowHtml <- addAttrs opts attr' $ H.tr $ do nl opts mconcat headcells mconcat bodycells |