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 escaped commas in uBO scriptlet parameters #95

Closed
scripthunter7 opened this issue Jun 18, 2023 · 3 comments
Closed

Fix escaped commas in uBO scriptlet parameters #95

scripthunter7 opened this issue Jun 18, 2023 · 3 comments
Assignees
Labels
bug Something isn't working Priority: P3 Resolution: Fixed Status: Closed T: syntax highlighter The issue is related to the syntax highlighting

Comments

@scripthunter7
Copy link
Member

scripthunter7 commented Jun 18, 2023

Escaped commas are highlighted incorrectly.

Example rule:

##+js(trusted-set-cookie, gravitoData, {"NonTCFVendors":[{"id":1\,"name":"Facebook"\,"consent":true}\,{"id":3\,"name":"Google"\,"consent":true}\,{"id":9\,"name":"Twitter"\,"consent":true}]}, 1year)

from https://github.com/uBlockOrigin/uAssets/blob/a7d6966930f7648d9cc5740f5b03fb05f86029d4/filters/annoyances-cookies.txt#L63

Show screenshot

image

Reported by @peace2000

@scripthunter7 scripthunter7 added the bug Something isn't working label Jun 18, 2023
@scripthunter7 scripthunter7 changed the title Fix commas in scriptlet parameters Fix escaped commas in uBO scriptlet parameters Jun 18, 2023
@scripthunter7 scripthunter7 added the T: syntax highlighter The issue is related to the syntax highlighting label Nov 8, 2023
@slavaleleka slavaleleka added T: syntax highlighter The issue is related to the syntax highlighting and removed T: syntax highlighter labels Nov 9, 2023
@peace2000
Copy link

peace2000 commented Dec 6, 2023

@scripthunter7 @slavaleleka On my end this doesn't seem to be fixed despite a month has passed since closing this issue.

Still escaped commas are shown in red: https://github.com/uBlockOrigin/uAssets/blob/a7d6966930f7648d9cc5740f5b03fb05f86029d4/filters/annoyances-cookies.txt#L63

Also, now as uBO has started to support using quotes in values https://github.com/uBlockOrigin/uAssets/blob/562d4c6043f38ec3786dc34119d26e711140d6cf/filters/annoyances-cookies.txt#L124 I see that the quoted value still has commas colored in red.

However, there seems to be no issues in quoted AG values for some reason https://github.com/AdguardTeam/AdguardFilters/blob/2c9040591d31c180b99e2a599e7150a7b5c7a2a5/AnnoyancesFilter/Cookies/sections/cookies_specific.txt#L232

@scripthunter7
Copy link
Member Author

@peace2000

Still escaped commas are shown in red: https://github.com/uBlockOrigin/uAssets/blob/a7d6966930f7648d9cc5740f5b03fb05f86029d4/filters/annoyances-cookies.txt#L63

GitHub highlighter takes time to update, you can learn more at https://github.com/AdguardTeam/VscodeAdblockSyntax#reporting-issues

Also, now as uBO has started to support using quotes in values https://github.com/uBlockOrigin/uAssets/blob/562d4c6043f38ec3786dc34119d26e711140d6cf/filters/annoyances-cookies.txt#L124 I see that the quoted value still has commas colored in red.

At first glance, this appears to be a new issue that needs to be fixed, since this feature is not yet supported by the highlighter.

However, there seems to be no issues in quoted AG values for some reason https://github.com/AdguardTeam/AdguardFilters/blob/2c9040591d31c180b99e2a599e7150a7b5c7a2a5/AnnoyancesFilter/Cookies/sections/cookies_specific.txt#L232

Yes, because the two types of scriptlet parameter management are a little different.

@peace2000
Copy link

Oh okay. Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: P3 Resolution: Fixed Status: Closed T: syntax highlighter The issue is related to the syntax highlighting
Projects
None yet
Development

No branches or pull requests

4 participants