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 backticks escaping #213

Merged
merged 1 commit into from
Mar 4, 2025
Merged

Fix backticks escaping #213

merged 1 commit into from
Mar 4, 2025

Conversation

farwayer
Copy link
Contributor

@farwayer farwayer commented Mar 4, 2025

Manually escaping characters for String.raw is not a trivial task and can cause errors #144 #181 #182 #198 etc.
Also, the need for postprocessing during initialization with replace slows down loading of large bundles.

This PR uses the standard js function JSON.stringify to escape the final html file.

Additional question. The code also uses ` escaping in string and css files. Why was this done? It seems that this can only create problems (for example, if the string already contains an escaped \`).

Copy link
Owner

@inokawa inokawa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Additional question. The code also uses ` escaping in string and css files. Why was this done?

Sorry, I forgot about its reason. It seems like I did it for some reason... 35da437

@inokawa inokawa merged commit a54748f into inokawa:main Mar 4, 2025
1 check passed
@inokawa
Copy link
Owner

inokawa commented Mar 4, 2025

0.12.4

@farwayer farwayer deleted the backticks-fix branch March 4, 2025 23:19
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