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 incorrect handling of double quotes in stringify function in CKEditor inspector. #190

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

Mati365
Copy link
Member

@Mati365 Mati365 commented Oct 28, 2024

Fix: Transform all single quotes passed to stringify function instead of only the first one.

Additional information

It looks like handling of " characters is broken in stringifySingleToDoubleQuotesReplacer, as it produces invalid JS code like this one:

stringify( `'foo'` ) // `""foo'"`

using replaceAll changes it to:

stringify( `'foo'` ) // `""foo""`

Which is still wrong because " are nested inside " character. I changed it to:

stringify( `'foo'` ) // `"\"foo\""`

Which looks better.

@Mati365 Mati365 requested a review from arkflpc October 28, 2024 12:15
@arkflpc arkflpc merged commit ff81aa5 into master Oct 28, 2024
5 checks passed
@arkflpc arkflpc deleted the ck/fix-wrong-stringify-quotes-handling branch October 28, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants