aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-01-14 19:54:17 +0300
committereug-vs <eug-vs@keemail.me>2021-01-14 19:54:17 +0300
commitce028df672325e2efaef2f9dbee05701328b0924 (patch)
tree0e3142abe7e3b57d07d9e8dcecb014ed555082fa
parentfa16b78695099fe28d233edc8cb6fce67e5e2648 (diff)
downloadreact-benzin-ce028df672325e2efaef2f9dbee05701328b0924.tar.gz
feat: allow passing plugins to Markdown
-rw-r--r--src/lib/Markdown/Markdown.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/Markdown/Markdown.tsx b/src/lib/Markdown/Markdown.tsx
index 32732ec..c0389dc 100644
--- a/src/lib/Markdown/Markdown.tsx
+++ b/src/lib/Markdown/Markdown.tsx
@@ -14,6 +14,8 @@ interface PropTypes {
url?: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context?: Record<string, any>;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ plugins?: any[]
}
const resolveUrls = (line: string, baseUrl: string): string => line.replace(
@@ -38,6 +40,7 @@ const Markdown: React.FC<PropTypes> = ({
url,
source,
context = {},
+ plugins = [],
}) => {
const [markdown, setMarkdown] = useState<string>(source || '');
@@ -69,7 +72,7 @@ const Markdown: React.FC<PropTypes> = ({
<ReactMarkdown
source={sanitized}
renderers={renderers}
- plugins={[emoji]}
+ plugins={[emoji, ...plugins]}
allowDangerousHtml
/>
</Typography>