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

(#276) Fixed dollar sign group replace in vue preprocessor #283

Merged

Conversation

adamDilger
Copy link
Contributor

@adamDilger adamDilger commented Feb 14, 2024

replace#specifying_a_string_as_the_replacement

When vue code contained groupings such as $' or $$, the call to "".replace() would treat these as special replacements producing invalid code.

Switching the replacement arg to a function returning the same string skips this logic.

The tests pass, and as this is only removing special functionality I would assume this is a safe change

EDIT: I've also added another commit to this PR which fixes having both a script and a script/setup tags in a SFC

@seanogdev
Copy link

I've applied this as a patch in our repo and this works perfectly, thanks @adamDilger 🙌

@seanogdev
Copy link

@ayusharma @byara Would we be able to get a release for this whenever you guys had a spare moment? 🙏

@adamDilger
Copy link
Contributor Author

I've added another bugfix onto this branch/PR, for #218 , as there would have been conflicting changes if these fixes were separated out.

If this is not valid I'm happy to revert and re-PR once the first fix has been merged

@adamkdean
Copy link

I found this issue even when $ exists in a string

@byara
Copy link
Collaborator

byara commented Dec 2, 2024

Hey @adamDilger I changes the base branch to v5. I hope it is OK. Can you please check wether everything is working as expected? If so, I'll merge this into v5 branch so we can release it later this week.

@adamDilger adamDilger force-pushed the bugfix/276-vue-unexpected-closing-script-tag branch from 936a47c to d091759 Compare December 2, 2024 10:34
@adamDilger
Copy link
Contributor Author

@byara I've rebased on v5, re-ran tests, and tested on a dummy project, everything looks good 👍

Thanks!

@byara byara merged commit 88776b3 into trivago:v5 Dec 2, 2024
3 checks passed
@byara byara mentioned this pull request Dec 4, 2024
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.

4 participants