mirror of https://github.com/sveltejs/svelte
fix: permit whitespace within template scripts (#10591)
parent
a2fbef2050
commit
ec52c75cc4
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: permit whitespace within template scripts
|
@ -0,0 +1,8 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
test({ assert, component, window }) {
|
||||||
|
document.dispatchEvent(new Event('DOMContentLoaded'));
|
||||||
|
assert.equal(window.document.querySelector('button')?.textContent, 'Hello world');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,10 @@
|
|||||||
|
<svelte:head>
|
||||||
|
<script>
|
||||||
|
// A comment
|
||||||
|
const val = 'Hello world';
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
document.querySelector('button').textContent = val;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</svelte:head>
|
||||||
|
<button />
|
Loading…
Reference in new issue