use only one markdown processing pipeline
Removes marked in favor of remark which is already used by astro.
This commit is contained in:
parent
0d5909ff58
commit
ab2a9ca7ed
3 changed files with 25 additions and 29 deletions
|
@ -1,5 +1,8 @@
|
|||
import { marked } from "marked";
|
||||
import markedAlert from "marked-alert";
|
||||
import { unified } from "unified";
|
||||
import remarkParse from "remark-parse";
|
||||
import remarkRehype from "remark-rehype";
|
||||
import rehypeStringify from "rehype-stringify";
|
||||
import { remarkAlert } from "remark-github-blockquote-alert";
|
||||
|
||||
import {
|
||||
// Flag,
|
||||
|
@ -77,10 +80,19 @@ export function groupRoutes(routes: RouteData[]): GroupedRoutes {
|
|||
|
||||
export function parseMarkdown(text?: string, title?: string) {
|
||||
if (!text) {
|
||||
return marked.parse(`${title}`);
|
||||
return unified()
|
||||
.use(remarkParse)
|
||||
.use(remarkRehype)
|
||||
.use(rehypeStringify)
|
||||
.process(title);
|
||||
}
|
||||
|
||||
return marked.use(markedAlert()).parse(text);
|
||||
return unified()
|
||||
.use(remarkParse)
|
||||
.use(remarkAlert)
|
||||
.use(remarkRehype)
|
||||
.use(rehypeStringify)
|
||||
.process(text);
|
||||
}
|
||||
|
||||
export function getQMLTypeLinkObject(unparsed: string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue