AdguardTeam / VscodeAdblockSyntax

Comprehensive extension to manage Adblock Syntax in VSCode: syntax highlighter, linter and much more. Available on the VSCode Marketplace.
https://marketplace.visualstudio.com/items?itemName=adguard.adblock
MIT License
74 stars 8 forks source link

Fix escaped commas in uBO scriptlet parameters #95

Closed scripthunter7 closed 10 months ago

scripthunter7 commented 1 year ago

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](https://github.com/AdguardTeam/VscodeAdblockSyntax/assets/57285466/28aa4e38-da3a-49d8-9b23-d9b83e66e97e)

Reported by @peace2000

peace2000 commented 10 months ago

@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 commented 10 months ago

@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 commented 10 months ago

Oh okay. Thanks for the info.