-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
08a9d12
commit 7737868
Showing
6 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: remove leading newline from `<pre>` contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/svelte/tests/hydration/samples/pre-first-node-newline/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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({}); |
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/hydration/samples/pre-first-node-newline/_expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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><!--]--> |
23 changes: 23 additions & 0 deletions
23
packages/svelte/tests/hydration/samples/pre-first-node-newline/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters