gfm()
创建 GFM 插件,启用 GitHub Flavored Markdown 扩展。
import { gfm } from "@unifast/node";签名
function gfm(options?: GfmPluginOptions): UnifastPlugin参数
options?
各项 GFM 特性的配置
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
tables | boolean | true | 启用以 | 为语法的管道表格 |
taskList | boolean | true | 启用 - [x] / - [ ] 任务列表复选框 |
strikethrough | boolean | true | 启用 |
footnotes | boolean | true | 启用 1 脚注引用与定义 |
autolink | boolean | true | 自动将裸 URL 转换为链接 |
用法
import { compile, gfm } from "@unifast/node";
const result = compile(md, {
plugins: [
gfm({
tables: true,
taskList: true,
strikethrough: true,
footnotes: true,
autolink: true,
}),
],
});