Enforce UNQUOTED_ATTR

This commit is contained in:
Wilson Lin 2018-08-05 13:04:01 +12:00
parent b42818a2e7
commit d6081bdd19
2 changed files with 5 additions and 2 deletions

View File

@ -75,8 +75,8 @@ It's an error if an attribute's name has any uppercase characters.
#### `HBE_PARSE_UNQUOTED_ATTR`
It's an error if an attribute's value is not quoted with `"` (U+0022).
This means that `` ` `` and `'` are not valid quote marks.
It's an error if an attribute's value is not quoted with `"` (U+0022) or `'` (U+0027).
This means that `` ` `` is not a valid quote mark regardless of whether this error is suppressed or not. Backticks are valid attribute value quotes in Internet Explorer.
#### `HBE_PARSE_ILLEGAL_CHILD`

View File

@ -39,6 +39,9 @@ void hbsh_attr(hbs_options_t so, hbu_pipe_t pipe) {
// Quoted attribute value
hbsh_quoteattrval(pipe);
} else {
if (!hbs_options_supressed_error(so, HBE_PARSE_UNQUOTED_ATTR)) {
hbu_pipe_error(pipe, HBE_PARSE_UNQUOTED_ATTR, "Unquoted attribute value");
}
// Unquoted attribute value
hbsh_unquoteattrval(pipe);
}