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 #1033 #1037

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix #1033 #1037

wants to merge 1 commit into from

Conversation

svdb99
Copy link

@svdb99 svdb99 commented Nov 26, 2024

Summary

Small fix for issue #1033

Background & Context

const TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);

Projects that use XSLT can inline 3rd party libs before pushing out the response to the browser. While doing so they can perform code resolution/substitutions on ${} espressions. Unfortunately the ${[\w\W]*} part can be misinterpreted as an expression even though it's in a regexp, and because it obviously doesn't resolve to anything during the transformation, it gets wiped out as a result and causes a syntax error when the browser gets it.
Result: const TMPLIT_EXPR = seal(/\/gm);

Proposed solution

The solution is extremely simple and doesn't change anything to how the regexp operates as it merely escapes the first curly brace.

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.

1 participant