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

Add support for unescaped commas within strings in uBO scriptlet injections #121

Open scripthunter7 opened 10 months ago

scripthunter7 commented 10 months ago

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.

Originally posted by @peace2000 in https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/95#issuecomment-1842587463

scripthunter7 commented 10 months ago

See

peace2000 commented 10 months ago

Thanks for opening this.

We typically quote parameters only if it's necessary, but all the variations should be highlighted properly, whether quoted or not. (Also the scriplet name can be quoted nowadays, but uBO doesn't have a scriptlet name that contains a comma :) )

example.com##+js(trusted-set-cookie, ConsentChecked, '{"userHasSetCookies":true,"marketingCookies":false}')

example.com##+js(trusted-set-cookie, 'Consent,Checked', '{"userHasSetCookies":true,"marketingCookies":false}')

example.com##+js(trusted-set-cookie, 'Consent,Checked', true)

example.com##+js('trusted-set-cookie', 'Consent,Checked', true)

example.com##+js('trusted-set-cookie', ConsentChecked, true)

All those should be highlighted correctly.