xmlhtml 0.2.3.3 → 0.2.3.4
raw patch · 3 files changed
+13/−12 lines, 3 filesdep ~basedep ~blaze-builderdep ~blaze-htmlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, blaze-builder, blaze-html, blaze-markup
API changes (from Hackage documentation)
Files
- src/Text/XmlHtml/HTML/Parse.hs +4/−4
- src/Text/XmlHtml/XML/Parse.hs +8/−7
- xmlhtml.cabal +1/−1
src/Text/XmlHtml/HTML/Parse.hs view
@@ -198,7 +198,7 @@ ------------------------------------------------------------------------------ attrName :: Parser Text attrName = takeWhile1 isAttrName- where isAttrName c | c `elem` "\0 \"\'>/=" = False+ where isAttrName c | c `elem` ['\0',' ','"','\'','>','/','='] = False | isControlChar c = False | otherwise = True @@ -216,15 +216,15 @@ quotedAttrValue :: Parser Text quotedAttrValue = singleQuoted <|> doubleQuoted where- singleQuoted = P.char '\'' *> refTill "&\'" <* P.char '\''- doubleQuoted = P.char '\"' *> refTill "&\"" <* P.char '\"'+ singleQuoted = P.char '\'' *> refTill ['&','\''] <* P.char '\''+ doubleQuoted = P.char '"' *> refTill ['&','"'] <* P.char '"' refTill end = T.concat <$> many (takeWhile1 (not . (`elem` end)) <|> reference) ------------------------------------------------------------------------------ unquotedAttrValue :: Parser Text-unquotedAttrValue = refTill " \"\'=<>&`"+unquotedAttrValue = refTill [' ','"','\'','=','<','>','&','`'] where refTill end = T.concat <$> some (takeWhile1 (not . (`elem` end)) <|> reference)
src/Text/XmlHtml/XML/Parse.hs view
@@ -138,7 +138,7 @@ ------------------------------------------------------------------------------ whiteSpace :: Parser ()-whiteSpace = some (P.satisfy (`elem` " \t\r\n")) *> return ()+whiteSpace = some (P.satisfy (`elem` [' ','\t','\r','\n'])) *> return () ------------------------------------------------------------------------------@@ -186,8 +186,8 @@ attrValue :: Parser Text attrValue = fmap T.concat (singleQuoted <|> doubleQuoted) where- singleQuoted = P.char '\'' *> refTill "<&\'" <* P.char '\''- doubleQuoted = P.char '\"' *> refTill "<&\"" <* P.char '\"'+ singleQuoted = P.char '\'' *> refTill ['<','&','\''] <* P.char '\''+ doubleQuoted = P.char '"' *> refTill ['<','&','"'] <* P.char '"' refTill end = many (takeWhile1 (not . (`elem` end)) <|> reference) @@ -228,16 +228,17 @@ isPubIdChar c | c >= 'a' && c <= 'z' = True | c >= 'A' && c <= 'Z' = True | c >= '0' && c <= '9' = True- | c `elem` " \r\n-\'()+,./:=?;!*#@$_%" = True+ | c `elem` otherChars = True | otherwise = False-+ where+ otherChars = " \r\n-\'()+,./:=?;!*#@$_%" :: [Char] ------------------------------------------------------------------------------ -- | The requirement to not contain "]]>" is for SGML compatibility. We -- deliberately choose to not enforce it. This makes the parser accept -- strictly more documents than a standards-compliant parser. charData :: Parser Node-charData = TextNode <$> takeWhile1 (not . (`elem` "<&"))+charData = TextNode <$> takeWhile1 (not . (`elem` ['<','&'])) ------------------------------------------------------------------------------@@ -595,6 +596,6 @@ isEnc c | c >= 'A' && c <= 'Z' = True | c >= 'a' && c <= 'z' = True | c >= '0' && c <= '9' = True- | c `elem` "._-" = True+ | c `elem` ['.','_','-'] = True | otherwise = False
xmlhtml.cabal view
@@ -1,5 +1,5 @@ Name: xmlhtml-Version: 0.2.3.3+Version: 0.2.3.4 Synopsis: XML parser and renderer with HTML 5 quirks mode Description: Contains renderers and parsers for both XML and HTML 5 document fragments, which share data structures so that