mirror of
https://github.com/alpmestan/taggy.git
synced 2024-08-16 10:20:30 +03:00
Permissively parse malformed closing tags, specifically those missing ">".
This commit is contained in:
parent
297c7d477c
commit
66b05584b7
@ -117,7 +117,7 @@ tagclose = do
|
||||
char '/'
|
||||
skipSpace
|
||||
i <- ident
|
||||
char '>'
|
||||
possibly '>'
|
||||
return $ TagClose i
|
||||
|
||||
tagtext :: Bool -> Parser Tag
|
||||
|
@ -96,6 +96,14 @@ spec = do
|
||||
, TagClose "body"
|
||||
, TagClose "html"
|
||||
]
|
||||
it "doesn't choke on malformed closing tags" $
|
||||
"<strong>North Korea</strong." ~> htmlWith False
|
||||
`shouldParse` [ TagOpen "strong" [] False
|
||||
, TagText "North Korea"
|
||||
, TagClose "strong"
|
||||
, TagText "."
|
||||
]
|
||||
|
||||
|
||||
(~>) :: Text -> Parser a -> Either String a
|
||||
(~>) = (Test.Hspec.Attoparsec.Source.~>)
|
||||
|
Loading…
Reference in New Issue
Block a user