aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-02-03 13:31:21 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2016-02-03 13:31:21 -0800
commit93a05dffd3d08bf2cb3a41e0523540c3c4bf5814 (patch)
tree8511891b027c8dd97e96fdb9a297fe4d09653cab /src/Text/Pandoc/Writers
parent7a10507dc8c2329f552b518bf7e9a1f044a33968 (diff)
downloadpandoc-93a05dffd3d08bf2cb3a41e0523540c3c4bf5814.tar.gz
HTML writer: don't include alignment attribute for default table columns.
Previously these were given "left" alignment. Better to leave off alignment attributes altogether. Closes #2694.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 6e199583e..c5b6a6db2 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -645,7 +645,7 @@ alignmentToString alignment = case alignment of
AlignLeft -> "left"
AlignRight -> "right"
AlignCenter -> "center"
- AlignDefault -> "left"
+ AlignDefault -> ""
tableItemToHtml :: WriterOptions
-> (Html -> Html)
@@ -658,7 +658,10 @@ tableItemToHtml opts tag' align' item = do
let attribs = if writerHtml5 opts
then A.style (toValue $ "text-align: " ++ alignStr ++ ";")
else A.align (toValue alignStr)
- return $ (tag' ! attribs $ contents) >> nl opts
+ let tag'' = if null alignStr
+ then tag'
+ else tag' ! attribs
+ return $ (tag'' $ contents) >> nl opts
toListItems :: WriterOptions -> [Html] -> [Html]
toListItems opts items = map (toListItem opts) items ++ [nl opts]