Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix decimal entities failing to parse if they contain leading zeros #8

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Html/Parser.elm
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ numericCharacterReference =
[ Parser.succeed identity
|. Parser.chompIf (\c -> c == 'x' || c == 'X')
|= hexadecimal
, Parser.int
, Parser.succeed identity
|. Parser.chompWhile ((==) '0')
|= Parser.int
]
in
Parser.succeed identity
Expand Down
1 change: 1 addition & 0 deletions tests/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ textNodeTests =
, test "decodeD" (testParse "a b" (Text "a\u{00A0}b"))
, test "decodeE" (testParse "a  b" (Text "a\u{00A0}\u{00A0}b"))
, test "decodeF" (testParse """<img alt="&lt;">""" (Element "img" [ ( "alt", "<" ) ] []))
, test "decodeG" (testParse "&#0038;" (Text "&"))
]


Expand Down