Skip to content

Commit

Permalink
fix: try fix shiki / latex again
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 committed Jul 14, 2024
1 parent d9279fa commit 1b51e2f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
21 changes: 19 additions & 2 deletions pages/threads/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,31 @@
import type { SerializeObject } from "nitropack";
import type { Message } from "openai/resources/beta/threads/messages";
import { emitter } from "~/src/emitter";
import markdownit from "markdown-it";
import * as markdownItLatex from "markdown-it-latex";
import Shiki from "@shikijs/markdown-it";
import "markdown-it-latex/dist/index.css";
import { createMarkdownIt } from "~/src/markdown";
const route = useRoute();
const id = route.params.id;
const { data, refresh } = await useFetch(`/api/threads/${route.params.id}`);
const md = await createMarkdownIt();
const md = markdownit();
try {
md.use(markdownItLatex.default);
md.use(
await Shiki({
fallbackLanguage: "sh",
themes: {
light: "github-dark",
dark: "github-dark",
},
}),
);
} catch (e) {
console.error("Error creating markdown renderer!", e);
}
const msg = ref("");
const textAreaRef = ref<{ textarea: HTMLTextAreaElement }>();
Expand Down
24 changes: 0 additions & 24 deletions src/markdown.ts

This file was deleted.

0 comments on commit 1b51e2f

Please sign in to comment.