mirror of
https://github.com/usememos/memos.git
synced 2024-10-04 07:17:52 +03:00
feat: support code in headings (#2488)
Co-authored-by: zty <zty.dev@outlook.com>
This commit is contained in:
parent
35f0861d6e
commit
184f79ef8e
@ -1,5 +1,6 @@
|
|||||||
import { marked } from "..";
|
import { marked } from "..";
|
||||||
import { matcher } from "../matcher";
|
import { matcher } from "../matcher";
|
||||||
|
import InlineCode from "./InlineCode";
|
||||||
import Link from "./Link";
|
import Link from "./Link";
|
||||||
import PlainLink from "./PlainLink";
|
import PlainLink from "./PlainLink";
|
||||||
import PlainText from "./PlainText";
|
import PlainText from "./PlainText";
|
||||||
@ -13,7 +14,7 @@ const renderer = (rawStr: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const level = matchResult[1].length;
|
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) {
|
if (level === 1) {
|
||||||
return <h1>{parsedContent}</h1>;
|
return <h1>{parsedContent}</h1>;
|
||||||
} else if (level === 2) {
|
} else if (level === 2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user