aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs2
-rw-r--r--test/Tests/Readers/HTML.hs14
2 files changed, 11 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index b305de7b5..0a9e4addf 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -205,6 +205,7 @@ block = ((do
| otherwise
-> pDiv
"section" -> pDiv
+ "header" -> pDiv
"main" -> pDiv
"figure" -> pFigure
"iframe" -> pIframe
@@ -404,6 +405,7 @@ pLineBlock = try $ do
isDivLike :: Text -> Bool
isDivLike "div" = True
isDivLike "section" = True
+isDivLike "header" = True
isDivLike "main" = True
isDivLike _ = False
diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs
index f23af2cb1..7f5849991 100644
--- a/test/Tests/Readers/HTML.hs
+++ b/test/Tests/Readers/HTML.hs
@@ -99,11 +99,15 @@ tests = [ testGroup "base tag"
plain (codeWith ("",["sample"],[]) "Answer is 42")
]
, testGroup "var"
- [
- test html "inline var block" $
- "<var>result</var>" =?>
- plain (codeWith ("",["variable"],[]) "result")
- ]
+ [ test html "inline var block" $
+ "<var>result</var>" =?>
+ plain (codeWith ("",["variable"],[]) "result")
+ ]
+ , testGroup "header"
+ [ test htmlNativeDivs "<header> is parsed as a div" $
+ "<header id=\"title\">Title</header>" =?>
+ divWith ("title", mempty, mempty) (plain "Title")
+ ]
, askOption $ \(QuickCheckTests numtests) ->
testProperty "Round trip" $
withMaxSuccess (if QuickCheckTests numtests == defaultValue