Fix unquoted ref in attribute value

Fixes regression of 4924cd6924
This commit is contained in:
Dan Neumann 2022-06-02 20:40:14 -05:00
parent 2042b27a04
commit 9bd9d39a8d
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -202,6 +202,10 @@ basicAttributeTests =
[]
]
)
, ( "quoted-ref", "<a x=\"&male;\"></a>", Ok [ Element "a" [ ( "x", "" ) ] [] ] )
, ( "quoted-non-ref", "<a x=\"u&me\"></a>", Ok [ Element "a" [ ( "x", "u&me" ) ] [] ] )
, ( "unquoted-ref", "<a x=&male;></a>", Ok [ Element "a" [ ( "x", "" ) ] [] ] )
, ( "unquoted-non-ref", "<a x=u&me></a>", Ok [ Element "a" [ ( "x", "u&me" ) ] [] ] )
]