11import React from "react" ;
22import ReactMarkdown from "react-markdown" ;
3- /**
4- * Recreate the old type to provide support until next major
5- */
6- import { PluggableList as PluggableListDeprecated } from "react-markdown-deprecated/lib/react-markdown" ;
73import { Prism as SyntaxHighlighter } from "react-syntax-highlighter" ;
84// @ts -ignore: No declaration file for module (TODO: should be @ts-expect-error but GUI elements is used inside project with `noImplicitAny=false`)
95import remarkTypograf from "@mavrin/remark-typograf" ;
106import rehypeExternalLinks from "rehype-external-links" ;
117import rehypeRaw from "rehype-raw" ;
128import { remarkDefinitionList } from "remark-definition-list" ;
139import remarkGfm from "remark-gfm" ;
14- import { PluggableList as PluggableListUnified } from "unified" ;
10+ import { PluggableList } from "unified" ;
1511
1612import { CLASSPREFIX as eccgui } from "../../configuration/constants" ;
1713import { HtmlContentBlock , HtmlContentBlockProps , TestableComponent } from "../../index" ;
18- type PluggableList = PluggableListUnified | PluggableListDeprecated ;
1914
2015export interface MarkdownProps extends TestableComponent {
2116 children : string ;
@@ -41,7 +36,6 @@ export interface MarkdownProps extends TestableComponent {
4136 /**
4237 * Additional reHype plugins to execute.
4338 * @see https://github.com/remarkjs/react-markdown#architecture
44- * @deprecated (v25) this property won't support `PluggableList` from "react-markdown/lib/react-markdown" with the next major version, only the one from `unified` will be supported then.
4539 */
4640 reHypePlugins ?: PluggableList ;
4741 /**
@@ -61,9 +55,9 @@ const configDefault = {
6155 @see https://github.com/remarkjs/react-markdown#api
6256 */
6357 // @see https://github.com/remarkjs/remark/blob/main/doc/plugins.md#list-of-plugins
64- remarkPlugins : [ remarkGfm , remarkTypograf , remarkDefinitionList ] as PluggableListUnified ,
58+ remarkPlugins : [ remarkGfm , remarkTypograf , remarkDefinitionList ] as PluggableList ,
6559 // @see https://github.com/rehypejs/rehype/blob/main/doc/plugins.md#list-of-plugins
66- rehypePlugins : [ ] as PluggableListUnified ,
60+ rehypePlugins : [ ] as PluggableList ,
6761 allowedElements : [
6862 // default markdown
6963 "a" ,
@@ -173,9 +167,7 @@ export const Markdown = ({
173167 } ;
174168
175169 if ( reHypePlugins ) {
176- reactMarkdownProperties . rehypePlugins = reactMarkdownProperties . rehypePlugins . concat (
177- reHypePlugins as PluggableListUnified
178- ) ;
170+ reactMarkdownProperties . rehypePlugins = reactMarkdownProperties . rehypePlugins . concat ( reHypePlugins ) ;
179171 }
180172
181173 const markdownDisplay = < ReactMarkdown { ...reactMarkdownProperties } /> ;
0 commit comments