{"id":13507,"library":"markdown-it-footnote","title":"markdown-it Footnote Plugin","description":"This package provides footnote support for the `markdown-it` markdown parser, implementing both standard and inline footnote syntax based on Pandoc's definition. It integrates seamlessly as a `markdown-it` plugin, extending the parser's capabilities to render footnote references and their corresponding definitions into semantic HTML, complete with back-references. The current stable version is 4.0.0. As a plugin for `markdown-it`, its release cycle often aligns with `markdown-it`'s own, though it maintains independent versioning. Its primary differentiator is its robust and spec-compliant implementation of footnotes within the `markdown-it` ecosystem, offering dedicated customization points for the rendered HTML structure, ensuring flexibility for various output requirements.","status":"active","version":"4.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/markdown-it/markdown-it-footnote","tags":["javascript","markdown-it-plugin","markdown-it","markdown","footnotes"],"install":[{"cmd":"npm install markdown-it-footnote","lang":"bash","label":"npm"},{"cmd":"yarn add markdown-it-footnote","lang":"bash","label":"yarn"},{"cmd":"pnpm add markdown-it-footnote","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency as this is a markdown-it plugin.","package":"markdown-it","optional":false}],"imports":[{"note":"This package is primarily distributed as a CommonJS module. While modern bundlers often handle ESM import syntax, direct ESM usage in Node.js environments might require specific transpilation or configuration.","wrong":"import markdownitFootnote from 'markdown-it-footnote';","symbol":"markdownitFootnote","correct":"const markdownitFootnote = require('markdown-it-footnote');"},{"note":"When loaded directly in a browser via a <script> tag, without a module system (like CommonJS or ES modules), the plugin exposes itself globally as 'window.markdownitFootnote'.","symbol":"markdownitFootnote (global)","correct":"const markdownitFootnote = window.markdownitFootnote;"}],"quickstart":{"code":"const markdownit = require('markdown-it');\nconst markdownitFootnote = require('markdown-it-footnote');\n\n// Initialize markdown-it and apply the footnote plugin\nconst md = markdownit().use(markdownitFootnote);\n\nconst markdownContent = `\nHere is a normal footnote reference,[^1] and another.[^longnote]\n\nHere is an inline note.^[Inlines notes are easier to write, since\nyou don't have to pick an identifier and move down to type the\nnote.]\n\n[^1]: Here is the footnote.\n\n[^longnote]: Here's one with multiple blocks.\n\n    Subsequent paragraphs are indented to show that they\nbelong to the previous footnote.\n\nThis paragraph won’t be part of the note, because it\nisn’t indented.\n`;\n\n// Render the markdown content to HTML\nconst html = md.render(markdownContent);\nconsole.log(html);","lang":"javascript","description":"Demonstrates how to initialize `markdown-it` with the footnote plugin and render markdown content containing both standard and inline footnotes."},"warnings":[{"fix":"Ensure your project uses `markdown-it` v5.0.0 or later. Upgrade `markdown-it` by running `npm install markdown-it@latest`.","message":"Version 2.0.0 and above of `markdown-it-footnote` requires `markdown-it` version 5.0.0 or higher. Older versions of `markdown-it` are incompatible and will cause parsing errors.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Access and override rules via `md.renderer.rules.<rule_name>` as shown in the package's documentation examples. Refer to the official `markdown-it` documentation for details on its renderer architecture and rule customization.","message":"Customizing the HTML output for footnotes requires overriding specific renderer rules on the `markdown-it` instance. Attempting to directly modify plugin internals or using undocumented APIs is not recommended as the API for template functions is tied to `markdown-it`'s internal renderer architecture.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'4.0.0':65 'align':77 'back':58 'back-refer':57 'base':25 'capabl':43 'complet':55 'compliant':98 'correspond':50 'current':61 'custom':110 'cycl':75 'dedic':109 'definit':29,51 'differenti':91 'ecosystem':107 'ensur':117 'extend':39 'flexibl':118 'footnot':4,9,23,46,101,132 'html':54,115 'implement':18,99 'independ':87 'inlin':22 'integr':31 'javascript':123 'maintain':86 'markdown':2,14,16,36,71,80,105,125,129,131 'markdown-it':1,13,35,70,79,104,128 'markdown-it-plugin':124 'offer':108 'often':76 'output':121 'packag':7 'pandoc':27 'parser':17,41 'plugin':5,38,68,127 'point':111 'primari':90 'provid':8 'refer':47,59 'releas':74 'render':45,114 'requir':122 'robust':94 'seamless':32 'semant':53 'spec':97 'spec-compli':96 'stabl':62 'standard':20 'structur':116 'support':10 'syntax':24 'though':84 'various':120 'version':63,88 'within':102","created_at":"2026-04-20T01:54:51.303327+00:00","updated_at":"2026-04-20T01:54:51.303327+00:00","problems":[{"fix":"Ensure `markdown-it` is imported and instantiated correctly before attempting to use the plugin: `const md = require('markdown-it')();`.","cause":"The `markdown-it` instance has not been correctly initialized, or the `use` method is being called on a non-`markdown-it` object.","error":"TypeError: md.use is not a function"},{"fix":"Verify that your footnote syntax precisely matches the Pandoc definition (e.g., normal footnotes: `[^id]` for reference and `[^id]:` for definition; inline footnotes: `^[note content]`). Temporarily disable other `markdown-it` plugins to identify potential conflicts.","cause":"This typically indicates incorrect markdown syntax for footnotes or a conflict with another `markdown-it` plugin altering parsing rules.","error":"Footnotes not rendering or displaying incorrectly in the HTML output."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/markdown-it/markdown-it-footnote","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/markdown-it-footnote","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}