refac: sources and citations

This commit is contained in:
Timothy Jaeryang Baek committed 2025-11-23 18:27:57 -05:00
1 parent b0491886bc
commit ec45d77ce9
11 files changed
+201 -62

No files matched your search

@@ -9,6 +9,8 @@
import { mentionExtension } from '$lib/utils/marked/mention-extension';
import MarkdownTokens from './Markdown/MarkdownTokens.svelte';
import footnoteExtension from '$lib/utils/marked/footnote-extension';
import citationExtension from '$lib/utils/marked/citation-extension';
export let id = '';
export let content;
@@ -39,6 +41,8 @@
marked.use(markedKatexExtension(options));
marked.use(markedExtension(options));
marked.use(citationExtension(options));
marked.use(footnoteExtension(options));
marked.use(disableSingleTilde);
marked.use({
extensions: [mentionExtension({ triggerChar: '@' }), mentionExtension({ triggerChar: '#' })]
@@ -47,7 +51,7 @@
$: (async () => {
if (content) {
tokens = marked.lexer(
replaceTokens(processResponseContent(content), sourceIds, model?.name, $user?.name)
replaceTokens(processResponseContent(content), model?.name, $user?.name)
);
}
})();
@@ -61,6 +65,7 @@
{save}
{preview}
{editCodeBlock}
{sourceIds}
{topPadding}
{onTaskClick}
{onSourceClick}