added support for markdown-it-footnote

this makes it possible to use footnotes
This commit is contained in:
Philip Molares 2020-06-20 17:45:02 +02:00 committed by mrdrogdrog
parent 2c81b746aa
commit ab2a73c6a8
4 changed files with 14 additions and 0 deletions

View file

@ -45,6 +45,7 @@
"markdown-it-emoji": "1.4.0",
"markdown-it-ins": "^3.0.0",
"markdown-it-mark": "^3.0.0",
"markdown-it-footnote": "^3.0.2",
"markdown-it-regex": "0.2.0",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",

View file

@ -9,6 +9,7 @@ import markdownItRegex from 'markdown-it-regex'
import subscript from 'markdown-it-sub'
import superscript from 'markdown-it-sup'
import taskList from 'markdown-it-task-lists'
import footnote from 'markdown-it-footnote'
import React, { ReactElement, useMemo } from 'react'
import ReactHtmlParser, { convertNodeToElement, Transform } from 'react-html-parser'
import { createRenderContainer, validAlertLevels } from './container-plugins/alert'
@ -49,6 +50,7 @@ const MarkdownPreview: React.FC<MarkdownPreviewProps> = ({ content }) => {
md.use(superscript)
md.use(inserted)
md.use(marked)
md.use(footnote)
md.use(markdownItRegex, replaceLegacyYoutubeShortCode)
md.use(markdownItRegex, replaceLegacyVimeoShortCode)
md.use(markdownItRegex, replaceLegacyGistShortCode)

View file

@ -0,0 +1,6 @@
declare module 'markdown-it-footnote' {
import MarkdownIt from 'markdown-it/lib'
const markdownItFootnote: MarkdownIt.PluginSimple
export = markdownItFootnote
}

View file

@ -7307,6 +7307,11 @@ markdown-it-mark@^3.0.0:
resolved "https://registry.yarnpkg.com/markdown-it-mark/-/markdown-it-mark-3.0.0.tgz#27c3e39ef3cc310b2dde5375082c9fa912983cda"
integrity sha512-HqMWeKfMMOu4zBO0emmxsoMWmbf2cPKZY1wP6FsTbKmicFfp5y4L3KXAsNeO1rM6NTJVOrNlLKMPjWzriBGspw==
markdown-it-footnote@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/markdown-it-footnote/-/markdown-it-footnote-3.0.2.tgz#1575ee7a093648d4e096aa33386b058d92ac8bc1"
integrity sha512-JVW6fCmZWjvMdDQSbOT3nnOQtd9iAXmw7hTSh26+v42BnvXeVyGMDBm5b/EZocMed2MbCAHiTX632vY0FyGB8A==
markdown-it-regex@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/markdown-it-regex/-/markdown-it-regex-0.2.0.tgz#e09ad2d75209720d591d3949e1142c75c0fbecf6"