hast-util-parse-selector

WebJar for hast-util-parse-selector

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

hast-util-parse-selector
Last Version

Last Version

2.2.5
Release Date

Release Date

Type

Type

jar
Description

Description

hast-util-parse-selector
WebJar for hast-util-parse-selector
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/syntax-tree/hast-util-parse-selector

Download hast-util-parse-selector

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/hast-util-parse-selector/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>hast-util-parse-selector</artifactId>
    <version>2.2.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/hast-util-parse-selector/
implementation 'org.webjars.npm:hast-util-parse-selector:2.2.5'
// https://jarcasting.com/artifacts/org.webjars.npm/hast-util-parse-selector/
implementation ("org.webjars.npm:hast-util-parse-selector:2.2.5")
'org.webjars.npm:hast-util-parse-selector:jar:2.2.5'
<dependency org="org.webjars.npm" name="hast-util-parse-selector" rev="2.2.5">
  <artifact name="hast-util-parse-selector" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='hast-util-parse-selector', version='2.2.5')
)
libraryDependencies += "org.webjars.npm" % "hast-util-parse-selector" % "2.2.5"
[org.webjars.npm/hast-util-parse-selector "2.2.5"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

hast-util-parse-selector

Build Coverage Downloads Size Sponsors Backers Chat

hast utility to create an element from a simple CSS selector.

Install

npm:

npm install hast-util-parse-selector

Use

var parseSelector = require('hast-util-parse-selector')

console.log(parseSelector('.quux#bar.baz.qux'))

Yields:

{ type: 'element',
  tagName: 'div',
  properties: { id: 'bar', className: [ 'quux', 'baz', 'qux' ] },
  children: [] }

API

parseSelector([selector][, defaultTagName])

Create an element node from a simple CSS selector.

selector

string, optional — 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, optional, defaults to div — Tag name to use if selector does not specify one.

Returns

Element.

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.

Do not use user input in selector or use hast-util-santize.

Related

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

org.webjars.npm
🌲🌲🌲🌳🌲🌳🌲🌲🌲🌳🌳🌲🌲🌳🌲🌲🎄🌲🌳🌲🌲🌳🐻🌳🌳🌳🌲🌲🌳🌲🎄🌲🌳🌲🌲🌳🌳🌳

Versions

Version
2.2.5