@@ -31,9 +31,41 @@ function Img(h, node) {
34+function Link(h, node) {
35+ const url = node.url;
38+ url.includes("https://urbit.org") ||
39+ url.startsWith("/") ||
48+ children: node.children,
59+ children: node.children,
34const options = {
64const options = {
65+ allowDangerousHtml: true,
35 handlers: {
66 handlers: {
36 image: Img,
67 image: Img,
38 sanitize: merge(github, {
70 sanitize: merge(github, {
39 // remove user-content from github.json to remark-slug work as expected
71 // remove user-content from github.json to remark-slug work as expected
@@ -45,14 +77,14 @@ const options = {
45// Converts markdown strings into markdown HTML/React components
77// Converts markdown strings into markdown HTML/React components
46export default async function Markdown({ post }, disablePlugins) {
78export default async function Markdown({ post }, disablePlugins) {
47 const result = await remark()
79 const result = await remark()
48− .use(remarkParse, options)
80+ .use(remarkParse)
49 .use(remarkprism, {
81 .use(remarkprism, {
50 plugins: !disablePlugins ? ["show-invisibles"] : [],
82 plugins: !disablePlugins ? ["show-invisibles"] : [],
53 .use(slug)
85 .use(slug)
54 .use(heading)
86 .use(heading)
55− .use(remarkRehype, { allowDangerousHtml: true })
87+ .use(remarkRehype, options)
56 .use(rehypeRaw)
88 .use(rehypeRaw)
57 .use(rehypeStringify)
89 .use(rehypeStringify)
58 .process(post.content);
90 .process(post.content);