Socket
Socket
Sign inDemoInstall

remark-numbered-footnotes

Package Overview
Dependencies
4
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remark-numbered-footnotes

This plugin replaces the footnote references with a number sequence (starting from 1) in the same order as the footnote definitions (**not** the footnote references).


Version published
Weekly downloads
379
decreased by-5.25%
Maintainers
2
Install size
56.1 kB
Created
Weekly downloads
 

Readme

Source

This plugin replaces the footnote references with a number sequence (starting from 1) in the same order as the footnote definitions (not the footnote references).

Reordering the definitions (usually put at the end of the document in the Markdown source) will therefore let you reorder the sequence.

This is useful if you want your footnotes to be superscript numbers without having to manually enter them while keeping the benefit of using strings that make sense to you in your Markdown source.

Warning

If you are using this plugin, your project is most certainly relying on mdast-util-to-hast. Run npm ls mdast-util-to-hast if you're unsure. Starting from mdast-util-to-hast@6.0.0, the footnote order changed. Before 6.0.0, footnotes were following the order in which they were defined, starting from 6.0.0 they follow the order of the references.

a[^first_footnote_reference]

b[^`b` second footnote reference but first footnote definition]

c[^last_footnote_reference]

[^last_footnote_reference]: `c` last footnote reference but second footnote definition
[^first_footnote_reference]: `a` first footnote reference but last footnote definition

Before 6.0.0:

image

After 6.0.0:

image

In the HTML ordered list, the list items 1/2/3 don't match the footnote references numbers anymore.

To avoid this issue you can either use older versions of your dependencies (not recommended) or visit the HAST tree after mdast-util-to-hast to fix the footnote orders (recommended). Here is an example. This way the above markdown will always generate HTML with matching footnote list items and footnote numbered references as can be seen below:

image

Keywords

FAQs

Last updated on 27 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc