mirror of
https://github.com/open-webui/open-webui
synced 2025-02-07 13:34:55 +00:00
fix: < rendering issue
This commit is contained in:
parent
e0054298a4
commit
0129f463b4
@ -69,7 +69,7 @@
|
|||||||
</del>
|
</del>
|
||||||
{:else if token.type === 'inlineKatex'}
|
{:else if token.type === 'inlineKatex'}
|
||||||
{#if token.text}
|
{#if token.text}
|
||||||
<KatexRenderer content={revertSanitizedResponseContent(token.text)} displayMode={false} />
|
<KatexRenderer content={token.text} displayMode={false} />
|
||||||
{/if}
|
{/if}
|
||||||
{:else if token.type === 'iframe'}
|
{:else if token.type === 'iframe'}
|
||||||
<iframe
|
<iframe
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
id={`${id}-${tokenIdx}`}
|
id={`${id}-${tokenIdx}`}
|
||||||
{token}
|
{token}
|
||||||
lang={token?.lang ?? ''}
|
lang={token?.lang ?? ''}
|
||||||
code={revertSanitizedResponseContent(token?.text ?? '')}
|
code={token?.text ?? ''}
|
||||||
{save}
|
{save}
|
||||||
on:code={(e) => {
|
on:code={(e) => {
|
||||||
dispatch('code', e.detail);
|
dispatch('code', e.detail);
|
||||||
@ -245,17 +245,11 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{:else if token.type === 'inlineKatex'}
|
{:else if token.type === 'inlineKatex'}
|
||||||
{#if token.text}
|
{#if token.text}
|
||||||
<KatexRenderer
|
<KatexRenderer content={token.text} displayMode={token?.displayMode ?? false} />
|
||||||
content={revertSanitizedResponseContent(token.text)}
|
|
||||||
displayMode={token?.displayMode ?? false}
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
{:else if token.type === 'blockKatex'}
|
{:else if token.type === 'blockKatex'}
|
||||||
{#if token.text}
|
{#if token.text}
|
||||||
<KatexRenderer
|
<KatexRenderer content={token.text} displayMode={token?.displayMode ?? false} />
|
||||||
content={revertSanitizedResponseContent(token.text)}
|
|
||||||
displayMode={token?.displayMode ?? false}
|
|
||||||
/>
|
|
||||||
{/if}
|
{/if}
|
||||||
{:else if token.type === 'space'}
|
{:else if token.type === 'space'}
|
||||||
<div class="my-2" />
|
<div class="my-2" />
|
||||||
|
@ -74,9 +74,6 @@ export const processResponseContent = (content: string) => {
|
|||||||
return content.trim();
|
return content.trim();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const revertSanitizedResponseContent = (content: string) => {
|
|
||||||
return content.replaceAll('<', '<').replaceAll('>', '>');
|
|
||||||
};
|
|
||||||
|
|
||||||
export function unescapeHtml(html: string) {
|
export function unescapeHtml(html: string) {
|
||||||
const doc = new DOMParser().parseFromString(html, 'text/html');
|
const doc = new DOMParser().parseFromString(html, 'text/html');
|
||||||
|
Loading…
Reference in New Issue
Block a user