Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for quoted attributes returning "§" (#26) #34

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

brettalewis
Copy link
Contributor

I noticed that when the regex for finding the strings ran, it was not actually finding the entirety of the string (it was grabbing the last character or two). I altered the regex to make the entire string within the quote be selected by making the original content variable a non-capturing group and making the repeated group the variable instead.

Doing this seems to fix all the issues where I saw the "§" value appear after tokenization. I manually tested this using any of the examples mentioned in the issue or the other PR attempting a fix:

footprint[uid="ca135f26-2b55-db63-7451-5a8effb2a19f"] > pad[uid="100a8763-0d5f-de60-23a5-00d74f3ecad7"]
[data-abcde="abcde"][data-xyz="xyz"]
a[attr="abcde"][attr="123"]

I also tried more complex examples where quotes may be escaped within the quote:
div:contains("this isn't \"correct\"")
div:contains('this isn\'t correct, "either"')

@brettalewis brettalewis changed the title fix for quoted attributes returning "§" #26 fix for quoted attributes returning "§" (#34) Nov 7, 2022
@brettalewis brettalewis changed the title fix for quoted attributes returning "§" (#34) fix for quoted attributes returning "§" (LeaVerou#34) Nov 7, 2022
@brettalewis brettalewis changed the title fix for quoted attributes returning "§" (LeaVerou#34) fix for quoted attributes returning "§" (LeaVerou#26) Nov 7, 2022
@brettalewis brettalewis changed the title fix for quoted attributes returning "§" (LeaVerou#26) fix for quoted attributes returning "§" (#26) Nov 7, 2022
@LeaVerou LeaVerou merged commit 7cefc70 into LeaVerou:master Nov 7, 2022
@LeaVerou
Copy link
Owner

LeaVerou commented Nov 7, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants