Skip to content

miaobuao/remark-footnotes-extra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remark-footnotes-extra

Install

pnpm add -D remark-footnotes-extra

Input:

hello world^[this is footnote]

Output:

output

Usage

import remarkFootnotesExtra from "remark-footnotes-extra";
import rehypeStringify from "rehype-stringify";
import remarkParse from "remark-parse";
import remarkRehype from "remark-rehype";
import { unified } from "unified";

const processor = unified()
    .use(remarkParse)
    .use(remarkFootnotesExtra)
    .use(remarkRehype, { allowDangerousHtml: true })
    .use(rehypeStringify);

const value = "hello world^[this is footnote]";
const file = await processor.process(value);
console.log(String(file));