You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b31e1b
Browse filesBrowse the repository at this point in the historyBrowse files
Fix(Source): Split Svelte and Vue script blocks only at real script tags
A `<script` inside a template expression, such as `{@html '<script>' + x}`,
or inside another element's attribute value started a script block, so
2.0.4 parsed template text as JavaScript and failed the build. The splitter
now skips Svelte `{…}` and Vue `{{ … }}` expressions (with their strings,
template literals and comments) and other elements' opening tags. This also
stops a `<script type="application/json">` string in `{@html}` from hiding
the rest of the template as a data block.
A component script block that still does not parse is read as text, as
before 2.0.4, and its syntax error is left to the framework's compiler.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
이 예외는 공유 워크스페이스 소스, 외부 콘텐츠, 범위가 지정된 가지치기 루트에 사용합니다. 상대 경로 규칙과 지원 형식은 [스캔 지시문](/reference/directives/scanning)을 참고하세요.
73
73
74
-
프레임워크 통합은 컴파일된 표시 문자열을 다시 스캔하기보다 원본 MDX, Vue, Svelte 소스를 우선합니다. Vue와 Svelte 컴포넌트 파일의 `<script>` 블록은 JavaScript로 읽으므로, 다른 JavaScript 소스와 마찬가지로 문자열과 템플릿 리터럴만 후보를 제공합니다. `items.length` 같은 속성 접근은 클래스가 아닙니다. `<style>` 블록은 클래스 소스가 아닙니다. 추출기의 언어 종류는 중요합니다. 의도적인 일반 텍스트 입력에는 `kind: 'raw'`를 사용할 수 있지만 파싱에 실패한 소스의 폴백으로 사용해서는 안 됩니다.
74
+
프레임워크 통합은 컴파일된 표시 문자열을 다시 스캔하기보다 원본 MDX, Vue, Svelte 소스를 우선합니다. Vue와 Svelte 컴포넌트 파일의 `<script>` 블록은 JavaScript로 읽으므로, 다른 JavaScript 소스와 마찬가지로 문자열과 템플릿 리터럴만 후보를 제공합니다. `items.length` 같은 속성 접근은 클래스가 아닙니다. script 블록을 시작하는 것은 컴포넌트 자체의 최상위 `<script>` 태그뿐입니다. 템플릿 표현식이나 속성 값에 쓰인 `<script>`는 템플릿 텍스트입니다. JavaScript나 TypeScript로 파싱할 수 없는 script 블록은 대신 텍스트로 읽고, 구문 오류 보고는 프레임워크 컴파일러에 맡깁니다. `<style>` 블록은 클래스 소스가 아닙니다. 추출기의 언어 종류는 중요합니다. 의도적인 일반 텍스트 입력에는 `kind: 'raw'`를 사용할 수 있지만 파싱에 실패한 소스의 폴백으로 사용해서는 안 됩니다.
Use these exceptions for shared workspace source, external content or a scoped pruning root. Their relative-path rules and supported forms belong to [Scanning directives](/reference/directives/scanning).
73
73
74
-
Framework integrations prefer original MDX, Vue and Svelte source to scanning compiled display strings a second time. Extraction reads the `<script>` blocks of Vue and Svelte component files as JavaScript, so only string and template literals there contribute candidates, as in other JavaScript sources; property access such as `items.length` is not a class. `<style>` blocks are not class sources. An extractor's language kind matters: intentional plain-text input can use `kind: 'raw'`, but that is not a fallback for a source that failed to parse.
74
+
Framework integrations prefer original MDX, Vue and Svelte source to scanning compiled display strings a second time. Extraction reads the `<script>` blocks of Vue and Svelte component files as JavaScript, so only string and template literals there contribute candidates, as in other JavaScript sources; property access such as `items.length` is not a class. Only a component's own top-level `<script>` tags start a script block; `<script>` written in a template expression or attribute value is template text. A script block that does not parse as JavaScript or TypeScript is read as text instead, leaving the syntax error to the framework's compiler. `<style>` blocks are not class sources. An extractor's language kind matters: intentional plain-text input can use `kind: 'raw'`, but that is not a fallback for a source that failed to parse.
0 commit comments