mirror of https://github.com/sveltejs/svelte
fix: remove leading newline from `<pre>` contents (#14922)
... if it's not followed by another newline, according to the spec Fixes #14767 --------- Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>unsafe-mutation-docs
parent
08a9d123e8
commit
77378688b9
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: remove leading newline from `<pre>` contents
|
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
// A note about _expected.html: It is different from body.html because we're
|
||||
// testing against target.innerHTML which already removed the redundant first newline
|
||||
export default test({});
|
@ -0,0 +1,7 @@
|
||||
<!--[--><pre>static content no line</pre> <pre> static content ignored line
|
||||
</pre> <pre>
|
||||
static content relevant line
|
||||
</pre> <pre><div><span></span></div>
|
||||
</pre> <pre>
|
||||
<div><span></span></div>
|
||||
</pre><!--]-->
|
@ -0,0 +1,23 @@
|
||||
<script>
|
||||
let name = $state('');
|
||||
</script>
|
||||
|
||||
<pre>static content no line</pre>
|
||||
|
||||
<pre>
|
||||
static content ignored line
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
|
||||
static content relevant line
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
<div><span>{name}</span></div>
|
||||
</pre>
|
||||
|
||||
<pre>
|
||||
|
||||
<div><span>{name}</span></div>
|
||||
</pre>
|
Loading…
Reference in new issue