Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

feat: add GFM table support in wiki editor and chat markdown

nash_su398ea25dcaf3
diff --git a/package-lock.json b/package-lock.json
index 9fa61e5d..4dd48ef1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -29,6 +29,7 @@
"react-i18next": "^17.0.2",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^4.9.0",
+ "remark-gfm": "^4.0.1",
"shadcn": "^4.1.2",
"sigma": "^3.0.2",
"tailwind-merge": "^3.5.0",
diff --git a/package.json b/package.json
index b44fa302..5a1ba503 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
"react-i18next": "^17.0.2",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^4.9.0",
+ "remark-gfm": "^4.0.1",
"shadcn": "^4.1.2",
"sigma": "^3.0.2",
"tailwind-merge": "^3.5.0",
diff --git a/src/components/chat/chat-message.tsx b/src/components/chat/chat-message.tsx
index fa5f4476..7cdcdb0c 100644
--- a/src/components/chat/chat-message.tsx
+++ b/src/components/chat/chat-message.tsx
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useRef, useState, useMemo } from "react"
import ReactMarkdown from "react-markdown"
+import remarkGfm from "remark-gfm"
import { Bot, User, FileText, Paperclip, BookmarkPlus } from "lucide-react"
import { useWikiStore } from "@/stores/wiki-store"
import { readFile, writeFile, listDirectory } from "@/commands/fs"
@@ -251,6 +252,7 @@ function MarkdownContent({ content }: { content: string }) {
return (
<div className="chat-markdown prose prose-sm max-w-none dark:prose-invert prose-p:my-1 prose-headings:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-pre:my-2 prose-code:text-xs prose-code:before:content-none prose-code:after:content-none">
<ReactMarkdown
+ remarkPlugins={[remarkGfm]}
components={{
a: ({ href, children }) => {
if (href?.startsWith("wikilink:")) {
diff --git a/src/components/editor/wiki-editor.tsx b/src/components/editor/wiki-editor.tsx
index d37db863..860586bb 100644
--- a/src/components/editor/wiki-editor.tsx
+++ b/src/components/editor/wiki-editor.tsx
@@ -1,5 +1,6 @@
import { Editor, rootCtx, defaultValueCtx } from "@milkdown/kit/core"
import { commonmark } from "@milkdown/kit/preset/commonmark"
+import { gfm } from "@milkdown/kit/preset/gfm"
import { history } from "@milkdown/kit/plugin/history"
import { listener, listenerCtx } from "@milkdown/kit/plugin/listener"
import { nord } from "@milkdown/theme-nord"
@@ -24,6 +25,7 @@ function WikiEditorInner({ content, onSave }: WikiEditorInnerProps) {
})
})
.use(commonmark)
+ .use(gfm)
.use(history)
.use(listener),
[content],