git.iko.soy/typeable/html-parse
on master help sign in
Fix attribute value parsing
commitbae6eb0a02d51bd443a0d83c041822c3df6831b2 authorBen Gamari <ben@smart-cactus.org> dateWed 6 Apr 2016, 01:55 (11 years ago) parent6d125f9
1 file changed+4−2
Text/HTML/Parser.hs+4−2
Text/HTML/Parser.hs+4−2
@@ -145,13 +145,15 @@ beforeAttrValue tag attrs name = do
145145-- | 8.2.4.38: Attribute value (double-quoted) state
146146attrValueDQuoted :: TagName -> [Attr] -> AttrName -> Parser Token
147147attrValueDQuoted tag attrs name = do
148− value <- takeTill (/= '"')
148+ value <- takeWhile (/= '"')
149+ char '"'
149150 afterAttrValueQuoted tag attrs name value
150151
151152-- | 8.2.4.39: Attribute value (single-quoted) state
152153attrValueSQuoted :: TagName -> [Attr] -> AttrName -> Parser Token
153154attrValueSQuoted tag attrs name = do
154− value <- takeTill (/= '\'')
155+ value <- takeWhile (/= '\'')
156+ char '\''
155157 afterAttrValueQuoted tag attrs name value
156158
157159-- | 8.2.4.40: Attribute value (unquoted) state