Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

feat: support code in headings (#2488)

zty184f79ef8efb
diff --git a/web/src/labs/marked/parser/Heading.tsx b/web/src/labs/marked/parser/Heading.tsx
index 2f4e05686..8fa8e1468 100644
--- a/web/src/labs/marked/parser/Heading.tsx
+++ b/web/src/labs/marked/parser/Heading.tsx
@@ -1,5 +1,6 @@
import { marked } from "..";
import { matcher } from "../matcher";
+import InlineCode from "./InlineCode";
import Link from "./Link";
import PlainLink from "./PlainLink";
import PlainText from "./PlainText";
@@ -13,7 +14,7 @@ const renderer = (rawStr: string) => {
}
const level = matchResult[1].length;
- const parsedContent = marked(matchResult[2], [], [Link, PlainLink, PlainText]);
+ const parsedContent = marked(matchResult[2], [], [InlineCode, Link, PlainLink, PlainText]);
if (level === 1) {
return <h1>{parsedContent}</h1>;
} else if (level === 2) {