Closed tomblachut closed 1 year ago
Was wondering if we can borrow XML handle of CDATA, just a thought if it might be that simple?
Maybe, good idea. Anyway this is doable on xml lexer level (SvelteHtmlHighlightingLexer
& SvelteHtmlLexer
), similar to how CSS and other style langs are handled, in that case lang will be plain text or "nothing".
Svelte {expressions} are handled on higher level, there's explicit exception for style
and script
so { } lexing is delegated to JS and CSS. We don't want this delegation in textarea
so SvelteHtmlLexer.flex
is unaffected
https://youtrack.jetbrains.com/issue/WEB-41745 fixed this issue, then https://github.com/sveltejs/svelte/pull/6148 happened, so now, Expressions inside textarea tag are parsed as plain text seems like a better issue name
Migrated to WEB-61784 Svelte: properly parse textarea tag content
Refer to this test: https://github.com/sveltejs/svelte/tree/master/test/parser/samples/textarea-children
And this repl:
https://svelte.dev/repl/1e98afa6a765431d9368139f9f48c6dc?version=3.24.1