Skip to content

Commit

Permalink
fix(dashboard): Add remark plugin on markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark committed Mar 27, 2023
1 parent 21578f7 commit deeadda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions superset-frontend/packages/superset-ui-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"react-markdown": "^8.0.3",
"rehype-raw": "^6.1.1",
"rehype-sanitize": "^5.0.1",
"remark-gfm": "^3.0.1",
"reselect": "^4.0.0",
"rison": "^0.1.1",
"seedrandom": "^3.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import React, { useMemo } from 'react';
import ReactMarkdown from 'react-markdown';
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
import rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm';
import { mergeWith, isArray } from 'lodash';
import { FeatureFlag, isFeatureEnabled } from '../utils';

Expand Down Expand Up @@ -63,7 +64,11 @@ function SafeMarkdown({

// React Markdown escapes HTML by default
return (
<ReactMarkdown rehypePlugins={rehypePlugins} skipHtml={!displayHtml}>
<ReactMarkdown
rehypePlugins={rehypePlugins}
remarkPlugins={[remarkGfm]}
skipHtml={!displayHtml}
>
{source}
</ReactMarkdown>
);
Expand Down

0 comments on commit deeadda

Please sign in to comment.