From 890005e6253517c575dbd109d7149c16b7c26160 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Sun, 3 Oct 2021 17:45:31 +0200 Subject: [PATCH] Add support for GFM footnotes --- index.js | 2 +- package.json | 4 ++-- readme.md | 22 +++++++++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 7c44ca4..370d655 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ export default function remarkGfm(options = {}) { const data = this.data() add('micromarkExtensions', gfm(options)) - add('fromMarkdownExtensions', gfmFromMarkdown) + add('fromMarkdownExtensions', gfmFromMarkdown()) add('toMarkdownExtensions', gfmToMarkdown(options)) /** diff --git a/package.json b/package.json index 22c8035..3e6c29c 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ ], "dependencies": { "@types/mdast": "^3.0.0", - "mdast-util-gfm": "^1.0.0", - "micromark-extension-gfm": "^1.0.0", + "mdast-util-gfm": "^2.0.0", + "micromark-extension-gfm": "^2.0.0", "unified": "^10.0.0" }, "devDependencies": { diff --git a/readme.md b/readme.md index 723b210..8b6c7bf 100644 --- a/readme.md +++ b/readme.md @@ -40,6 +40,12 @@ Say we have the following file, `example.md`: www.example.com, https://example.com, and contact@example.com. +## Footnote + +A note[^1] + +[^1]: Big note. + ## Strikethrough ~one~ or ~~two~~ tildes. @@ -80,11 +86,16 @@ unified() Now, running `node example` yields: -```html +```txt example.md: no issues found +``` + +```html

GFM

Autolink literals

www.example.com, https://example.com, and contact@example.com.

+

Footnote

+

A note1

Strikethrough

one or two tildes.

Table

@@ -103,6 +114,13 @@ example.md: no issues found
  • to do
  • done
  • +

    Footnotes

    +
      +
    1. +

      Big note.

      +
    2. +
    +
    ``` ## API @@ -155,8 +173,6 @@ attacks. * [`remark-github`](https://github.com/remarkjs/remark-github) — Autolink references like in GitHub issues, PRs, and comments -* [`remark-footnotes`](https://github.com/remarkjs/remark-footnotes) - — Footnotes * [`remark-frontmatter`](https://github.com/remarkjs/remark-frontmatter) — Frontmatter (YAML, TOML, and more) * [`remark-math`](https://github.com/remarkjs/remark-math)