You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Done in the 7.2.0 release, and thanks for the precise list: it is what made this straightforward to pick up five years later.
API.md now documents, with examples:
node.stringifyProperty(name) and node.valueToString(), including the fact that valueToString() carries the marker the node type adds, a . for a class, a # for an id, the namespace prefix for an attribute or a tag.
node.setPropertyAndEscape(), node.appendToPropertyAndEscape() and node.setPropertyWithoutEscape(), under a new section explaining why a node keeps both a value and a raw value, and that these exist for non-standard syntax where the escaped form cannot be derived from the value.
The seventeen type guards in one table, with what each is true for, plus the two names that trip people up: the guard for an id selector is isIdentifier rather than isId, and isPseudoClass is defined as a pseudo that is not a pseudo-element, so it is true for an unknown :whatever.
The opts argument of node.clone(), and that its assignments go through the node's setters, so a property that escapes on assignment escapes there too.
Every example and every row of the guard table was checked against the built parser.
Activity
MoOx commentedon Nov 8, 2026
Done in the 7.2.0 release, and thanks for the precise list: it is what made this straightforward to pick up five years later.
API.mdnow documents, with examples:node.stringifyProperty(name)andnode.valueToString(), including the fact thatvalueToString()carries the marker the node type adds, a.for a class, a#for an id, the namespace prefix for an attribute or a tag.node.setPropertyAndEscape(),node.appendToPropertyAndEscape()andnode.setPropertyWithoutEscape(), under a new section explaining why a node keeps both a value and a raw value, and that these exist for non-standard syntax where the escaped form cannot be derived from the value.isIdentifierrather thanisId, andisPseudoClassis defined as a pseudo that is not a pseudo-element, so it is true for an unknown:whatever.optsargument ofnode.clone(), and that its assignments go through the node's setters, so a property that escapes on assignment escapes there too.Every example and every row of the guard table was checked against the built parser.
docs: document the raw-value helpers, the type guards and clone overr…