perf: skip re-sanitizing unchanged HTML tokens (#26325)
This commit is contained in:
1 parent
7292cee868
commit
62b153749a
1 file changed
+2
-5
@@ -10,11 +10,8 @@
|
|||||||
|
|
||||||
let html: string | null = null;
|
let html: string | null = null;
|
||||||
|
|
||||||
$: if (token.type === 'html' && token?.text) {
|
$: text = token.type === 'html' ? token?.text : null;
|
||||||
html = DOMPurify.sanitize(token.text);
|
$: html = text ? DOMPurify.sanitize(text) : null;
|
||||||
} else {
|
|
||||||
html = null;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if token.type === 'html'}
|
{#if token.type === 'html'}
|
||||||
|
|||||||
Reference in new issue
Block a user