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
This package exports the identifier parseSelector.
There is no default export.
parseSelector(selector?[, defaultTagName])
Create a hast element from a simple CSS selector.
Parameters
selector (string, optional)
— simple CSS selector, can contain a tag name (foo), classes (.bar),
and an ID (#baz), multiple classes are allowed, uses the last ID if
multiple IDs are found
defaultTagName (string, default: 'div')
— tag name to use if selector does not specify one
This package is fully typed with TypeScript.
It exports no additional types.
Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
hast-util-parse-selector@^4, compatible with Node.js 16.
Security
Improper use of the selector or defaultTagName can open you up to a
cross-site scripting (XSS) attack as the value of tagName, when
resolving to script, injects a script element into the syntax tree.