Skip to content

Commit

Permalink
fix supersub
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleguido committed Sep 9, 2024
1 parent d2963ee commit 244b75e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"react-turnstile": "^1.1.2",
"remark-footnotes": "^4.0.1",
"remark-gfm": "^3.0.1",
"remark-supersub": "^1.0.0",
"simplex-noise": "^3.0.1",
"three": "0.151.3",
"three.modifiers": "^2.5.7",
Expand Down Expand Up @@ -86,7 +87,6 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"http-proxy-middleware": "^2.0.6",
"prettier": "^3.3.3"
"http-proxy-middleware": "^2.0.6"
}
}
5 changes: 3 additions & 2 deletions src/components/StoryModule/ModuleText.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import supersub from 'remark-supersub'
import { all } from 'mdast-util-to-hast'
import FootnoteReference from './FootnoteReference'
import FootnoteDefinition from './FootnoteDefinition'
Expand Down Expand Up @@ -33,7 +34,7 @@ const ModuleText = ({ content = '', language, footnotes = [], printFootnotes = t
: `[${num}](${FootnoteDefinitionPrefix}/${num})`
}) // VERY IMPORTANT, we build FAKE footnotes! as we hve now sections.
// replace -- with —
.replace(/--/g, '—')
.replace(/--/g, '—'),
]
// console.debug('[ModuleText]', chunks)
const footnoteIndex = {}
Expand Down Expand Up @@ -81,7 +82,7 @@ const ModuleText = ({ content = '', language, footnotes = [], printFootnotes = t
},
},
}}
remarkPlugins={[remarkGfm]}
remarkPlugins={[remarkGfm, supersub]}
>
{chunks.join('\n\n')}
</ReactMarkdown>
Expand Down
12 changes: 7 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6674,11 +6674,6 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==

prettier@^3.3.3:
version "3.3.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105"
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==

pretty-format@^27.0.2:
version "27.5.1"
resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz"
Expand Down Expand Up @@ -7185,6 +7180,13 @@ remark-rehype@^10.0.0:
mdast-util-to-hast "^12.1.0"
unified "^10.0.0"

remark-supersub@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/remark-supersub/-/remark-supersub-1.0.0.tgz#b2009884781961a37990f5581360cbe0e1632ab1"
integrity sha512-3SYsphMqpAWbr8AZozdcypozinl/lly3e7BEwPG3YT5J9uZQaDcELBF6/sr/OZoAlFxy2nhNFWSrZBu/ZPRT3Q==
dependencies:
unist-util-visit "^4.0.0"

[email protected]:
version "0.4.2"
resolved "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.2.tgz"
Expand Down

0 comments on commit 244b75e

Please sign in to comment.