Fix references in onepass

This commit is contained in:
Wilson Lin 2021-08-08 19:00:51 +10:00
commit 4fc9496829
6 changed files with 26 additions and 14 deletions

View file

@ -46,6 +46,10 @@ const WHITESPACE_OR_SLASH_OR_EQUALS_OR_RIGHT_CHEVRON = [
const DOUBLE_QUOTE = [c('"')];
const SINGLE_QUOTE = [c("'")];
// Official characters allowed in an attribute name.
// NOTE: Unicode noncharacters not tested.
// See https://html.spec.whatwg.org/multipage/syntax.html#syntax-attribute-name for spec.
const WHATWG_ATTR_NAME_CHAR = invert([...CONTROL, c(' '), c('"'), c('\''), c('>'), c('/'), c('=')]);
// Valid attribute quote characters.
// See https://html.spec.whatwg.org/multipage/introduction.html#intro-early-example for spec.
// Backtick is not a valid quote character according to spec.
@ -88,6 +92,7 @@ impl std::ops::Index<u8> for Lookup {
WHITESPACE_OR_SLASH,
WHITESPACE_OR_SLASH_OR_EQUALS_OR_RIGHT_CHEVRON,
WHATWG_ATTR_NAME_CHAR,
DOUBLE_QUOTE,
SINGLE_QUOTE,
ATTR_QUOTE,