Skip to content

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

2 participants