-
Notifications
You must be signed in to change notification settings - Fork 162
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
Escape gradle string in shareTarget / build.gradle #674
Conversation
Escapes the gradle string before escaping the JSON. This ensures single quotes are escaped. Fixes #673
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this method come from? I can't find the docs for it.
I feel uneasy about escaping a string twice - how do we know this won't do something crazy?
It's set here: https://github.com/GoogleChromeLabs/bubblewrap/blob/main/packages/core/src/lib/TwaGenerator.ts#L404. And the implementation at bubblewrap/packages/core/src/lib/util.ts Lines 289 to 298 in 78581c2
|
Yeah, that would be good, thanks. |
Added a test. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % nit thanks
describe('#escapeJsonString combined with #escapeGradleString returns the expected results', | ||
() => { | ||
it('Escapes double and single quotes', () => { | ||
// String.raw prevents escape characters from being applied, so we can simplify howe we write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo on "how"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Escapes the gradle string before escaping the JSON. This ensures single quotes
are escaped.
Fixes #673