Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ea13aa94
authored
2024-11-07 18:08:45 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
If the value passed to getAttrValueMatch is quoted, then remove the
quotes.
1 parent
2626a712
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
0 deletions
lib/html.ts
lib/html.ts
View file @
ea13aa9
...
...
@@ -98,6 +98,7 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
const
getAttrValueMatch
=
(
value
:
string
,
operator
:
string
=
'='
,
caseSensitive
:
boolean
):
AttrValueMatch
=>
{
if
(
value
===
undefined
)
return
(
attrValue
)
=>
attrValue
!==
undefined
if
(
value
[
0
]
===
'"'
||
value
[
0
]
===
'\''
)
value
=
value
.
substring
(
1
,
value
.
length
-
1
)
const
isCaseInsensitive
=
caseSensitive
===
'i'
if
(
isCaseInsensitive
)
value
=
value
.
toLowerCase
()
const
adjustMatcher
=
(
matcher
)
=>
isCaseInsensitive
?
(
attrValue
)
=>
matcher
(
attrValue
.
toLowerCase
())
:
matcher
...
...
Please
register
or
sign in
to post a comment