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

Single quotes are being escaped in JSON serialization #474

Closed
zemzelett opened this issue Jan 7, 2024 · 1 comment
Closed

Single quotes are being escaped in JSON serialization #474

zemzelett opened this issue Jan 7, 2024 · 1 comment
Labels
available on master bug Something isn't working

Comments

@zemzelett
Copy link

Hi there,

i was dabbling with my bar config yesterday and noticed some error arising from parsing the JSON output of sketchybar --query with jq:

jq: parse error: Invalid escape at line 124, column 98

This error message came from a value i provided to a click_script property:

click_script="open -a 'System Preferences'"

Changing this to the following made the error disappear:

click_script="open -a \"System Preferences\""

The problem with the first one is, that the apostrophe is being escaped during serialization since the following commit: 14c6381

I can't tell, why that has been introduced but the apostrophe is a character that must not be escaped according to RFC 7159 Section 7.

Sadly, jq does not parse the rest of the JSON due to the error being thrown.

Again, i'm not sure what led to the decision of escaping apostrophes but, in my opinion, this should either be fixed by (preferably) reverting the above commit or by adding something to the documentation hinting towards this behavior.

@FelixKratz
Copy link
Owner

FelixKratz commented Jan 7, 2024

Agreed, reverted commit 14c6381 and included in v2.19.6

@FelixKratz FelixKratz added bug Something isn't working available on master labels Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants