Skip to content

Commit

Permalink
Markdown block: add support for footnotes.
Browse files Browse the repository at this point in the history
Fixes #11849

Also see #18035 and #11881.

This involves bringing in a new dependency to the Jetpack plugin:

- https://github.com/markdown-it/markdown-it-footnote
- MIT License
  • Loading branch information
jeherve committed Apr 18, 2023
1 parent fd90454 commit b0489e8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: enhancement

Markdown Block: add support for footnotes
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import { __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles
import { RawHTML } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import MarkdownIt from 'markdown-it';
import footnote_plugin from 'markdown-it-footnote';

/**
* Module variables
*/
const markdownConverter = new MarkdownIt();
const markdownConverter = new MarkdownIt().use( footnote_plugin );
const handleLinkClick = event => {
if ( event.target.nodeName === 'A' ) {
const hasConfirmed = window.confirm(
Expand Down
1 change: 1 addition & 0 deletions projects/plugins/jetpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"jsdom": "20.0.3",
"mapbox-gl": "1.13.0",
"markdown-it": "12.3.2",
"markdown-it-footnote": "3.0.3",
"photon": "4.0.0",
"postcss-custom-properties": "12.1.7",
"prop-types": "15.7.2",
Expand Down

0 comments on commit b0489e8

Please sign in to comment.