aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/HTML
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/HTML')
-rw-r--r--src/Text/Pandoc/Readers/HTML/Table.hs2
-rw-r--r--src/Text/Pandoc/Readers/HTML/TagCategories.hs13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/HTML/Table.hs b/src/Text/Pandoc/Readers/HTML/Table.hs
index 6179ea8e7..b8091d7e9 100644
--- a/src/Text/Pandoc/Readers/HTML/Table.hs
+++ b/src/Text/Pandoc/Readers/HTML/Table.hs
@@ -216,7 +216,7 @@ normalize widths head' bodies foot = do
let rows = headRows head' <> concatMap bodyRows bodies <> footRows foot
let cellWidth (Cell _ _ _ (ColSpan cs) _) = cs
let rowLength = foldr (\cell acc -> cellWidth cell + acc) 0 . rowCells
- let ncols = maximum (map rowLength rows)
+ let ncols = fromMaybe 0 $ viaNonEmpty maximum1 (map rowLength rows)
let tblType = tableType (map rowCells rows)
-- fail on empty table
if null rows
diff --git a/src/Text/Pandoc/Readers/HTML/TagCategories.hs b/src/Text/Pandoc/Readers/HTML/TagCategories.hs
index b7bd40fee..a339b2e76 100644
--- a/src/Text/Pandoc/Readers/HTML/TagCategories.hs
+++ b/src/Text/Pandoc/Readers/HTML/TagCategories.hs
@@ -21,17 +21,18 @@ module Text.Pandoc.Readers.HTML.TagCategories
)
where
-import Data.Set (Set, fromList, unions)
+import Data.Set (Set)
+import qualified Data.Set as Set
import Data.Text (Text)
eitherBlockOrInline :: Set Text
-eitherBlockOrInline = fromList
+eitherBlockOrInline = Set.fromList
["audio", "applet", "button", "iframe", "embed",
"del", "ins", "progress", "map", "area", "noscript", "script",
"object", "svg", "video", "source"]
blockHtmlTags :: Set Text
-blockHtmlTags = fromList
+blockHtmlTags = Set.fromList
["?xml", "!DOCTYPE", "address", "article", "aside",
"blockquote", "body", "canvas",
"caption", "center", "col", "colgroup", "dd", "details",
@@ -48,7 +49,7 @@ blockHtmlTags = fromList
-- We want to allow raw docbook in markdown documents, so we
-- include docbook block tags here too.
blockDocBookTags :: Set Text
-blockDocBookTags = fromList
+blockDocBookTags = Set.fromList
["calloutlist", "bibliolist", "glosslist", "itemizedlist",
"orderedlist", "segmentedlist", "simplelist",
"variablelist", "caution", "important", "note", "tip",
@@ -63,10 +64,10 @@ blockDocBookTags = fromList
"sidebar", "title"]
epubTags :: Set Text
-epubTags = fromList ["case", "switch", "default"]
+epubTags = Set.fromList ["case", "switch", "default"]
blockTags :: Set Text
-blockTags = unions [blockHtmlTags, blockDocBookTags, epubTags]
+blockTags = Set.unions [blockHtmlTags, blockDocBookTags, epubTags]
sectioningContent :: [Text]
sectioningContent = ["article", "aside", "nav", "section"]