mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
Default KaTeX Rendering
This commit is contained in:
@@ -250,19 +250,6 @@
|
|||||||
return '`rendermath' + math.trim() + '`'
|
return '`rendermath' + math.trim() + '`'
|
||||||
})
|
})
|
||||||
|
|
||||||
// .replace(/\\\[((?:\s|\S)*?)\\\]/g, (match, math) => {
|
|
||||||
// return '\n```rendermath\n' + math.trim() + '\n```\n'
|
|
||||||
// })
|
|
||||||
// .replace(/\$\$((?:\s|\S)*?)\$\$/g, (match, math) => {
|
|
||||||
// return '\n```rendermath\n' + math.trim() + '\n```\n'
|
|
||||||
// })
|
|
||||||
// .replace(/\\\((?!\$)(.*?[^\\])\\\)/g, (match, math) => {
|
|
||||||
// return '`rendermath' + math.trim() + '`'
|
|
||||||
// })
|
|
||||||
// .replace(/(?<!\\|\$)\$(?!\$)(.*?[^\\])\$(?!\$)/g, (match, math) => {
|
|
||||||
// return '`rendermath' + math.trim() + '`'
|
|
||||||
// })
|
|
||||||
|
|
||||||
text = text.replace(new RegExp(`${codeBlockPlaceholderPrefix}idx(\\d+)__`, 'g'), (match, p1) => {
|
text = text.replace(new RegExp(`${codeBlockPlaceholderPrefix}idx(\\d+)__`, 'g'), (match, p1) => {
|
||||||
return codeBlocks[p1]
|
return codeBlocks[p1]
|
||||||
})
|
})
|
||||||
@@ -313,8 +300,8 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#key refreshCounter}
|
{#key refreshCounter}
|
||||||
<SvelteMarkdown
|
<SvelteMarkdown
|
||||||
bind:source={displayMessage}
|
source={preprocessMath(displayMessage)}
|
||||||
options={markdownOptions}
|
options={markdownOptions}
|
||||||
renderers={renderers}
|
renderers={renderers}
|
||||||
/>
|
/>
|
||||||
{/key}
|
{/key}
|
||||||
|
|||||||
Reference in New Issue
Block a user