mirror of
https://github.com/danneu/html-parser.git
synced 2024-11-25 08:19:17 +03:00
parent
2042b27a04
commit
9bd9d39a8d
@ -298,10 +298,8 @@ isSpace c =
|
||||
attributeValueUnquoted : Config -> Parser String
|
||||
attributeValueUnquoted cfg =
|
||||
let
|
||||
-- isUnquotedValueChar c =
|
||||
-- not (isSpace c) && c /= '"' && c /= '\'' && c /= '=' && c /= '<' && c /= '>' && c /= '`' && c /= '&'
|
||||
isLenientUnquotedValueChar c =
|
||||
not (isSpace c) && c /= '>'
|
||||
not (isSpace c) && c /= '>' && c /= '&'
|
||||
in
|
||||
oneOf
|
||||
[ chompOneOrMore isLenientUnquotedValueChar
|
||||
|
@ -202,6 +202,10 @@ basicAttributeTests =
|
||||
[]
|
||||
]
|
||||
)
|
||||
, ( "quoted-ref", "<a x=\"♂\"></a>", Ok [ Element "a" [ ( "x", "♂" ) ] [] ] )
|
||||
, ( "quoted-non-ref", "<a x=\"u&me\"></a>", Ok [ Element "a" [ ( "x", "u&me" ) ] [] ] )
|
||||
, ( "unquoted-ref", "<a x=♂></a>", Ok [ Element "a" [ ( "x", "♂" ) ] [] ] )
|
||||
, ( "unquoted-non-ref", "<a x=u&me></a>", Ok [ Element "a" [ ( "x", "u&me" ) ] [] ] )
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user