Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@markuplint/selector
Advanced tools
$ npm install @markuplint/selector
$ yarn add @markuplint/selector
Supported selectors and operators:
Selector Type | Code Example | Support |
---|---|---|
Universal selector | * | ✅ |
Type selector | div | ✅ |
ID selector | #id | ✅ |
Class selector | .class | ✅ |
Attribute selector | [data-attr] | ✅ |
Attribute selector, Exact match | [data-attr=value] [data-attr=value i] | ✅ |
Attribute selector, Include whitespace separated | [data-attr~=value] [data-attr~=value i] | ✅ |
Attribute selector, Subcode match | [data-attr|=value] [data-attr|=value i] | ✅ |
Attribute selector, Partial match | [data-attr*=value] [data-attr*=value i] | ✅ |
Attribute selector, Forward match | [data-attr^=value] [data-attr^=value i] | ✅ |
Attribute selector, Backward match | [data-attr$=value] [data-attr$=value i] | ✅ |
Negation pseudo-class | :not(div) | ✅ |
Matches-Any pseudo-class | :is(div) | ✅ |
Specificity-adjustment pseudo-class | :where(div) | ✅ |
Relational pseudo-class | :has(div) :has(> div) :has(+ div) :has(~ div) | ✅ |
Directionality pseudo-class | :dir(ltr) | ❌ |
Language pseudo-class | :lang(en) | ❌ |
Hyperlink pseudo-class | :any-link | ❌ |
Link History pseudo-class | :link :visited | ❌ |
Local link pseudo-class | :local-link | ❌ |
Target pseudo-class | :target | ❌ |
Target container pseudo-class | :target-within | ❌ |
Reference element pseudo-class | :scope | ✅ |
Current-element pseudo-class | :current :current(div) | ❌ |
Past pseudo-class | :past | ❌ |
Future pseudo-class | :future | ❌ |
Interactive pseudo-class | :active :hover :focus :focus-within :focus-visible | ❌ |
Enable and disable pseudo-class | :enable :disable | ❌ |
Mutability pseudo-class | :read-write :read-only | ❌ |
Placeholder-shown pseudo-class | :placeholder-shown | ❌ |
Default-option pseudo-class | :default | ❌ |
Selected-option pseudo-class | :checked | ❌ |
Indeterminate value pseudo-class | :indeterminate | ❌ |
Validity pseudo-class | :valid :invalid | ❌ |
Range pseudo-class | :in-range :out-of-range | ❌ |
Optionality pseudo-class | :required :optional | ❌ |
Empty-Value pseudo-class | :blank | ❌ |
User-interaction pseudo-class | :user-invalid | ❌ |
Root pseudo-class | :root | ✅ |
Empty pseudo-class | :empty | ❌ |
Nth-child pseudo-class | :nth-child(2) :nth-last-child(2) :first-child :last-child :only-child | ❌ |
Nth-child pseudo-class (of El Syntax) | :nth-child(2 of div) :nth-last-child(2 of div) | ❌ |
Nth-of-type pseudo-class | :nth-of-type(2) :nth-last-of-type(2) :first-of-type :last-of-type :only-of-type | ❌ |
Nth-col pseudo-class | :nth-col(2) :nth-last-col(2) | ❌ |
Pseudo elements | ::before ::after | ❌ |
Descendant combinator | div span | ✅ |
Child combinator | div > span (:has(> span) ) | ✅ |
Next-sibling combinator | div + span (:has(+ span) ) | ✅ |
Subsequent-sibling combinator | div ~ span (:has(~ span) ) | ✅ |
Column combinator | div || span | ❌ |
Multiple selectors | div, span | ✅ |
The below is selectors that are extended by markuplint:
Selector Type | Code Example |
---|---|
ARIA pseudo-class | :aria(has name) |
:aria(syntax)
:aria(syntax/version)
Syntax | Example | Description |
---|---|---|
has name | :aria(has name) :aria(has name/1.1) | It has accessible name |
has no name | :aria(has no name) :aria(has no name/1.1) | It does'nt have accessible name |
role is Role | :aria(role is banner) :aria(role is generic/1.2) | It matches the specfied role |
{
"nodeName": "/^[a-z]+$/",
"attrName": "/^[a-z]+$/",
"attrValue": "/^[a-z]+$/"
}
FAQs
Extended W3C Selectors matcher
The npm package @markuplint/selector receives a total of 11,865 weekly downloads. As such, @markuplint/selector popularity was classified as popular.
We found that @markuplint/selector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.