HTML writer: parse <header>
as a Div
HTML5 `<header>` elements are treated like `<div>` elements.
This commit is contained in:
parent
46baf6659d
commit
0794862aac
2 changed files with 11 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue