uibee 2.17.0 → 2.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Components } from 'react-markdown';
|
|
2
|
+
export default function MarkdownRender({ MDstr, components, className }: {
|
|
2
3
|
MDstr: string;
|
|
4
|
+
components?: Components;
|
|
5
|
+
className?: string;
|
|
3
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Markdown from 'react-markdown';
|
|
3
3
|
import remarkGfm from 'remark-gfm';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const defaultComponents = {
|
|
5
|
+
h1: ({ ...props }) => _jsx("h2", { ...props }),
|
|
6
|
+
};
|
|
7
|
+
export default function MarkdownRender({ MDstr, components, className }) {
|
|
8
|
+
return (_jsx("div", { className: className ?? 'prose prose-sm prose-custom max-w-none', children: _jsx(Markdown, { components: { ...defaultComponents, ...components }, remarkPlugins: [remarkGfm], children: MDstr.replace(/\\n/g, '\n') }) }));
|
|
6
9
|
}
|
package/package.json
CHANGED