Skip to content

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

Merged
byara merged 2 commits into
trivago:v5from
adamDilger:bugfix/276-vue-unexpected-closing-script-tag
Dec 2, 2024
Merged

(#276) Fixed dollar sign group replace in vue preprocessor#283
byara merged 2 commits into
trivago:v5from
adamDilger:bugfix/276-vue-unexpected-closing-script-tag

Conversation

@adamDilger
Copy link
Copy Markdown
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
Copy Markdown

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

@seanogdev
Copy link
Copy Markdown

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

@adamDilger
Copy link
Copy Markdown
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
Copy Markdown

I found this issue even when $ exists in a string

@byara
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

Thanks!

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