aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 1789b865f..cee7ea300 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -131,6 +131,7 @@ block = do
, eSwitch B.para block
, mempty <$ eFootnote
, mempty <$ eTOC
+ , mempty <$ eTitlePage
, pPara
, pHeader
, pBlockQuote
@@ -334,9 +335,13 @@ headerLevel tagtype = do
<|>
return level
-
-
-
+eTitlePage :: TagParser ()
+eTitlePage = try $ do
+ let isTitlePage as = maybe False (isInfixOf "titlepage") (lookup "type" as)
+ let groupTag = tagOpen (\x -> x `elem` groupingContent || x == "section")
+ isTitlePage
+ TagOpen tag _ <- lookAhead $ pSatisfy groupTag
+ () <$ pInTags tag block
pHeader :: TagParser Blocks
pHeader = try $ do
@@ -922,13 +927,14 @@ instance HasLastStrPosition HTMLState where
sectioningContent :: [String]
sectioningContent = ["article", "aside", "nav", "section"]
-{-
+
groupingContent :: [String]
groupingContent = ["p", "hr", "pre", "blockquote", "ol"
, "ul", "li", "dl", "dt", "dt", "dd"
, "figure", "figcaption", "div", "main"]
+{-
types :: [(String, ([String], Int))]
types = -- Document divisions