|
@@ -33,20 +33,24 @@
|
|
|
<MarkdownInlineTokens id={`${id}-${tokenIdx}-h`} tokens={token.tokens} />
|
|
|
</svelte:element>
|
|
|
{:else if token.type === 'code'}
|
|
|
- <CodeBlock
|
|
|
- id={`${id}-${tokenIdx}`}
|
|
|
- {token}
|
|
|
- lang={token?.lang ?? ''}
|
|
|
- code={revertSanitizedResponseContent(token?.text ?? '')}
|
|
|
- {save}
|
|
|
- on:save={(e) => {
|
|
|
- dispatch('update', {
|
|
|
- raw: token.raw,
|
|
|
- oldContent: token.text,
|
|
|
- newContent: e.detail
|
|
|
- });
|
|
|
- }}
|
|
|
- />
|
|
|
+ {#if token.raw.includes('```')}
|
|
|
+ <CodeBlock
|
|
|
+ id={`${id}-${tokenIdx}`}
|
|
|
+ {token}
|
|
|
+ lang={token?.lang ?? ''}
|
|
|
+ code={revertSanitizedResponseContent(token?.text ?? '')}
|
|
|
+ {save}
|
|
|
+ on:save={(e) => {
|
|
|
+ dispatch('update', {
|
|
|
+ raw: token.raw,
|
|
|
+ oldContent: token.text,
|
|
|
+ newContent: e.detail
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ {:else}
|
|
|
+ {unescapeHtml(token.text)}
|
|
|
+ {/if}
|
|
|
{:else if token.type === 'table'}
|
|
|
<div class="scrollbar-hidden relative whitespace-nowrap overflow-x-auto max-w-full">
|
|
|
<table class="w-full">
|