From f1f2728259ca0258a9870028a5c05b5973efdc20 Mon Sep 17 00:00:00 2001 From: Andy Morris Date: Fri, 30 Oct 2020 15:22:46 +0100 Subject: Fix duplicate "class" attribute in HTML writer --- src/Text/Pandoc/Writers/HTML.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3