diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2014-08-12 23:03:24 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2014-08-12 23:03:24 +0100 |
commit | 34cf0162512f2f75805b2b2ff947026bc9f67b2c (patch) | |
tree | b691c87b77b6860dee8f89a584e0eedd034d87fb /src/Text | |
parent | 4c88e64894af56a71a15289a70b2ae7950157f86 (diff) | |
download | pandoc-34cf0162512f2f75805b2b2ff947026bc9f67b2c.tar.gz |
EPUB Reader: Ignore title pages
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 14 |
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 |