Skip to content

Commit

Permalink
Merge pull request #11 from magopian/10-dont-parse-invalid-characters…
Browse files Browse the repository at this point in the history
…-for-attribute-names

Fixes #10
  • Loading branch information
hecrj authored Apr 9, 2019
2 parents 42f759c + 12b783c commit 8022add
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Html/Parser.elm
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ isTagAttributeCharacter c =

isSpaceCharacter : Char -> Bool
isSpaceCharacter c =
c == ' ' || c == '\t' || c == '\n' || c == '\u{000D}' || c == '\u{000C}'
c == ' ' || c == '\t' || c == '\n' || c == '\u{000D}' || c == '\u{000C}' || c == '\u{00A0}'



Expand Down
3 changes: 3 additions & 0 deletions tests/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ attributeTests =
, test "basic13" (testParse """<html xmlns:v="urn:schemas-microsoft-com:vml"></html>""" (Element "html" [ ( "xmlns:v", "urn:schemas-microsoft-com:vml" ) ] []))
, test "basic14" (testParse """<link rel=stylesheet
href="">""" (Element "link" [ ( "rel", "stylesheet" ), ( "href", "" ) ] []))

-- Invalid attribute names shouldn't be parsed: https://github.com/elm/html/issues/46
, test "invalid character" (testParse """<p\u{00A0} ></p>""" (Element "p" [] []))
]


Expand Down

0 comments on commit 8022add

Please sign in to comment.