-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: claim svg tags in raw mustache tags correctly (#8910)
fixes #8904
- Loading branch information
1 parent
800f6c0
commit 35221c8
Showing
12 changed files
with
57 additions
and
12 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: claim svg tags in raw mustache tags correctly |
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
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,3 @@ | ||
<svg> | ||
<circle cx="200" cy="500" r="200"></circle> | ||
</svg> |
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 @@ | ||
<svg> | ||
<!-- HTML_TAG_START --> | ||
<circle cx="200" cy="500" r="200"></circle> | ||
<!-- HTML_TAG_END --> | ||
</svg> |
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,14 @@ | ||
export default { | ||
snapshot(target) { | ||
const svg = target.querySelector('svg'); | ||
|
||
return { | ||
svg, | ||
circle: svg.querySelector('circle') | ||
}; | ||
}, | ||
test(assert, _, snapshot) { | ||
assert.instanceOf(snapshot.svg, SVGElement); | ||
assert.instanceOf(snapshot.circle, SVGElement); | ||
} | ||
}; |
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 @@ | ||
<svg>{@html '<circle cx="200" cy="500" r="200"></circle>'}</svg> |
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 |
---|---|---|
@@ -1,4 +1,2 @@ | ||
<noscript></noscript> | ||
<p>this is some html</p> | ||
<p>and so is this</p> | ||
<noscript></noscript> |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
<!-- HTML_TAG_START --> | ||
<p>this is some html</p> | ||
<p>and so is this</p> | ||
<!-- HTML_TAG_END --> |
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
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
{@html raw} | ||
<script> | ||
export let raw; | ||
</script> | ||
|
||
{@html raw} |
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,10 @@ | ||
export default { | ||
html: '', | ||
|
||
test({ assert, component, target }) { | ||
component.show = true; | ||
assert.equal(target.innerHTML, '<svg><circle cx="200" cy="500" r="200"></circle></svg>'); | ||
assert.instanceOf(target.querySelector('svg'), SVGElement); | ||
assert.instanceOf(target.querySelector('circle'), SVGElement); | ||
} | ||
}; |
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 @@ | ||
<script> | ||
export let show = false; | ||
</script> | ||
|
||
{#if show} | ||
<svg>{@html '<circle cx="200" cy="500" r="200"></circle>'}</svg> | ||
{/if} |