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(scan): handle html script tag attributes that contain ">" #13101

Merged
merged 1 commit into from May 5, 2023

Conversation

yyx990803
Copy link
Member

@yyx990803 yyx990803 commented May 5, 2023

The case occurs with Vue 3 generics usage but is technically possible in other scenarios as well. E.g. for <script foo=">">console.log(1)</script>, the previous regex matches ">console.log(1) as the script content and causes a esbuild parse error.

ref: vuejs/core#8171

This PR uses a more complex regex that accounts for arbitrary attributes on the <script tag>. Also refactored the logic to use a single regex for both HTML and HTML-like file types.

…s ">"

The case occurs with Vue 3 generics usage but is technically possible in other scenarios as well

ref: vuejs/core#8171
@stackblitz
Copy link

stackblitz bot commented May 5, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented May 5, 2023

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ✅ success
iles ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt ❌ failure
previewjs ✅ success
qwik ✅ success
rakkas ✅ success
sveltekit ✅ success
vite-plugin-ssr ❌ failure
vite-plugin-react ✅ success
vite-plugin-react-pages ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success
windicss ✅ success

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecosystem-ci is good, Nuxt and vite-plugin-ssr are currently failing against main

@patak-dev patak-dev merged commit 8a37de6 into main May 5, 2023
14 checks passed
@patak-dev patak-dev deleted the fix-scan-vue-generics branch May 5, 2023 09:59
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.

None yet

2 participants