Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Update for micromark in remark@13
Browse files Browse the repository at this point in the history
* Update to a micromark parser, defer work to
  <https://github.com/micromark/micromark-extension-footnote>,
  <https://github.com/syntax-tree/mdast-util-footnote>
* Change footnote reference to match link references:
  footnote references are only parsed when defined
* Change footnote definitions to match lists:
  footnote definitions can now interrupt block quotes, lists, and
  paragraphs
  • Loading branch information
wooorm committed Oct 4, 2020
1 parent 52942dc commit 0cfeae1
Show file tree
Hide file tree
Showing 16 changed files with 524 additions and 1,678 deletions.
522 changes: 31 additions & 491 deletions index.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,26 @@
"types/index.d.ts",
"index.js"
],
"dependencies": {},
"dependencies": {
"mdast-util-footnote": "^0.1.0",
"micromark-extension-footnote": "^0.3.0"
},
"devDependencies": {
"dtslint": "^4.0.0",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"rehype-format": "^3.0.0",
"rehype-stringify": "^8.0.0",
"remark-cli": "^8.0.0",
"remark-parse": "^8.0.0",
"remark-parse": "^9.0.0-alpha.1",
"remark-preset-wooorm": "^7.0.0",
"remark-rehype": "^8.0.0",
"remark-stringify": "^8.0.0",
"remark-stringify": "^9.0.0-alpha.1",
"tape": "^5.0.0",
"to-vfile": "^6.0.0",
"unified": "^9.0.0",
"unist-builder": "^2.0.0",
"unist-util-remove-position": "^3.0.0",
"xo": "^0.33.0"
},
"scripts": {
Expand Down
28 changes: 20 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

[**remark**][remark] plugin to add support for footnotes.

## Important!

This plugin is affected by the new parser in remark
([`micromark`](https://github.com/micromark/micromark),
see [`remarkjs/remark#536`](https://github.com/remarkjs/remark/pull/536)).
Use version 2 while you’re still on remark 12.
Use version 3 for remark 13+.

## Install

[npm][]:
Expand Down Expand Up @@ -121,13 +129,15 @@ Plugin to add support for footnotes.
###### `options.inlineNotes`

Whether to support `^[inline notes]` (`boolean`, default: `false`).
Passed to [`micromark-extension-footnote`][mm-footnote].

###### Notes

* Labels, such as `[^this]` (in a footnote reference) or `[^this]:` (in a
footnote definition) cannot contain whitespace
footnote definition) work like link references
* Footnote definitions work like lists
* Image and link references cannot start with carets, so `![^this doesn’t
work][]`, and `[^neither does this][]`
work][]`

## Security

Expand All @@ -137,14 +147,14 @@ scripting (XSS)][xss] attacks.

## Related

* [`remark-breaks`](https://github.com/remarkjs/remark-breaks)
More breaks
* [`remark-gfm`](https://github.com/remarkjs/remark-gfm)
GitHub Flavored Markdown
* [`remark-frontmatter`](https://github.com/remarkjs/remark-frontmatter)
— Frontmatter (yaml, toml, and more) support
— Frontmatter (YAML, TOML, and more)
* [`remark-math`](https://github.com/remarkjs/remark-math)
— Math
* [`remark-github`](https://github.com/remarkjs/remark-github)
— References to issues, PRs, comments, users, etc
* [`remark-math`](https://github.com/rokt33r/remark-math)
— Inline and block math
— Auto-link references like in GitHub issues, PRs, and comments

## Contribute

Expand Down Expand Up @@ -209,3 +219,5 @@ abide by its terms.
[rehype]: https://github.com/rehypejs/rehype

[hast]: https://github.com/syntax-tree/hast

[mm-footnote]: https://github.com/micromark/micromark-extension-footnote#optionsinlinenotes
Loading

0 comments on commit 0cfeae1

Please sign in to comment.