aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-12 16:56:38 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-12 16:56:38 -0700
commit7684b24959ebe49da036d14ed75d585e7afe2da6 (patch)
tree86c9404494f84b3651cc03ab2f27822d035e901a /src/Text
parent52c58175cab1d3b7ce86c6d72c67d93b8555cec3 (diff)
parent063ba81622431d81b00b0b5526c8829e05b5787e (diff)
downloadpandoc-7684b24959ebe49da036d14ed75d585e7afe2da6.tar.gz
Merge pull request #1528 from mpickering/epubtitlepage
EPUB Reader: Ignores titlepage attribute
Diffstat (limited to 'src/Text')
-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