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

RegExp.$1 breaks file #162

Open
gkemp94 opened this issue Mar 22, 2022 · 1 comment
Open

RegExp.$1 breaks file #162

gkemp94 opened this issue Mar 22, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@gkemp94
Copy link

gkemp94 commented Mar 22, 2022

The following line in the utility module 'plugins/utils/update.ts' doesn't take into account any cases where $n might exist within the the file for example when using RegExp.$1 and outputs invalid syntax.

        .replace(/^(\s*)[^]*?(\s*)$/, `$1${printedNextNode}$2`);

A potential fix would be to escaping any dollar signs within the printedNextNode printedNextNode.replace(/\$/g, '$$$$')

@Rudeg Rudeg added the bug Something isn't working label Mar 28, 2022
@Calidus
Copy link
Contributor

Calidus commented Aug 26, 2022

Would this be potentially why I am seeing '$' get turned into a single quote mark '?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants