Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Access content between 2 a start tag and an end tag #1443

Open
Open
Access content between 2 a start tag and an end tag#1443
Labels
keep-unstaleThe issue will not be marked as stale by the stale-bot

Description

I have some HTML code in that between style tag I will write some styles with classes. When added event listener with text it is not selecting the text

To Reproduce

parser.addListener('tagstart', function (event) {
if (event.tagName.toLowerCase() === 'style') {
insideStyleTag = true
}
})

parser.addListener('tagend', function (event) {
if (event.tagName.toLowerCase() === 'style') {
insideStyleTag = false
}
})

parser.addListener('text', function (event) {
if (insideStyleTag) {
console.log('event', event)
const cssText = event.raw
const cssClassRegex = /\.([\w-]+)/g
let match
while ((match = cssClassRegex.exec(cssText)) !== null) {
classNames.add(match[1])
}
}
})

I am expecting the content to be available at text listener

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-unstaleThe issue will not be marked as stale by the stale-bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions