1import remark from "remark";
2import gfm from "remark-gfm";
3import slug from "remark-slug";
4import heading from "remark-heading-id";
5import remarkprism from "remark-prism";
6import normalize from "mdurl/encode";
7import merge from "deepmerge";
8import github from "hast-util-sanitize/lib/github";
9import remarkParse from "remark-parse";
10import remarkRehype from "remark-rehype";
11import rehypeStringify from "rehype-stringify";
12import rehypeRaw from "rehype-raw";
14// img is wrapped in figure so that images can be extra wide in the blog posts
15function Img(h, node) {
16 var props = { src: normalize(node.url), alt: node.alt };
17 if (node.title !== null && node.title !== undefined) {
18 props.title = node.title;
38 sanitize: merge(github, {
39 // remove user-content from github.json to remark-slug work as expected
41 attributes: { "*": ["className"] },
45// Converts markdown strings into markdown HTML/React components
46export default async function Markdown({ post }, disablePlugins) {
47 const result = await remark()
48 .use(remarkParse, options)
50 plugins: !disablePlugins ? ["show-invisibles"] : [],
55 .use(remarkRehype, { allowDangerousHtml: true })
58 .process(post.content);
60 return result.toString();
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list