mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
perf: skip re-sanitizing unchanged HTML tokens (#26325)
This commit is contained in:
parent
7292cee868
commit
62b153749a
1 changed files with 2 additions and 5 deletions
|
|
@ -10,11 +10,8 @@
|
|||
|
||||
let html: string | null = null;
|
||||
|
||||
$: if (token.type === 'html' && token?.text) {
|
||||
html = DOMPurify.sanitize(token.text);
|
||||
} else {
|
||||
html = null;
|
||||
}
|
||||
$: text = token.type === 'html' ? token?.text : null;
|
||||
$: html = text ? DOMPurify.sanitize(text) : null;
|
||||
</script>
|
||||
|
||||
{#if token.type === 'html'}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue