mirror of https://github.com/sveltejs/svelte
* fix: escape `innerText` and `textContent` bindings of `contenteditable` * fix: better if else structurepull/17802/head
parent
0298e97937
commit
0df5abcae2
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: escape `innerText` and `textContent` bindings of `contenteditable`
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<!--[--><div contenteditable=""><script>alert('pwnd')</script></div> <div contenteditable=""><script>alert('pwnd')</script></div> <div contenteditable=""><script>alert('pwnd')</script></div><!--]-->
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
let data = $state("<scri"+"pt>alert('pwnd')</scr"+"ipt>");
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div contenteditable bind:innerText={data}></div>
|
||||||
|
<div contenteditable bind:textContent={data}></div>
|
||||||
|
<div contenteditable bind:innerHTML={data}></div>
|
||||||
Loading…
Reference in new issue