vblog
Viewing readonly version: 179View latest version
Script
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import rehypeStringify from "npm:rehype-stringify";
import remarkParse from "npm:remark-parse";
import remarkRehype from "npm:remark-rehype";
import { unified } from "npm:unified";
import type { Plugin, Post } from "./types";
const parser = unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeStringify);
export const markdown: Plugin = async (post: Post) => {
const file = await parser.process(post.content);
const html = String(file);
return {
...post,
html,
};
};
H
www