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
06a33897
authored
2024-11-27 10:33:32 -0600
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix complex matching, don't always add the node to left, and fix ' '.
1 parent
f277360d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
7 deletions
lib/html.ts
lib/html.ts
View file @
06a3389
...
...
@@ -171,16 +171,9 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
leftMatches
.
add
(
node
)
}
if
(
!
rightMatcher
(
context
,
node
,
parent
,
i
,
debug
))
return
false
leftMatches
.
add
(
node
)
if
(
debug
)
console
.
log
(
'matched on right'
,
{
left
,
right
,
combinator
,
pos
,
node
,
parent
})
switch
(
combinator
)
{
case
' '
:
let
parentPtr
=
parent
while
(
parentPtr
)
{
if
(
leftMatches
.
has
(
parentPtr
))
return
true
parentPtr
=
parentPtr
.
parent
}
return
false
case
'>'
:
if
(
debug
)
console
.
log
(
'leftMatches parent'
,
leftMatches
.
has
(
parent
))
return
parent
?
leftMatches
.
has
(
parent
)
:
false
...
...
Please
register
or
sign in
to post a comment