Skip to content

Commit

Permalink
Merge pull request #4104 from alisman/fixmarkdown
Browse files Browse the repository at this point in the history
Add back github friendly markdown support to static markdown component
  • Loading branch information
inodb authored Dec 28, 2021
2 parents 4b88d66 + f118008 commit 563926c
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
"regression": "^2.0.1",
"rehype-raw": "^6.1.0",
"rehype-sanitize": "^5.0.0",
"remark-gfm": "^3.0.1",
"render-if": "^0.1.1",
"reselect": "^2.5.4",
"resolve-url-loader": "^1.6.1",
Expand Down
3 changes: 2 additions & 1 deletion src/shared/components/staticContent/StaticContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { observer } from 'mobx-react';
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import rehypeSanitize from 'rehype-sanitize';
import remarkGfm from 'remark-gfm';
import { getServerConfig } from 'config/config';
import { remoteData } from 'cbioportal-frontend-commons';
import LoadingIndicator from '../loadingIndicator/LoadingIndicator';
Expand Down Expand Up @@ -44,7 +45,7 @@ export default class StaticContent extends React.Component<
components={this.props.renderers || {}}
className={'markdown-body'}
children={this.source.result!}
rehypePlugins={[rehypeRaw, rehypeSanitize]}
rehypePlugins={[rehypeRaw, rehypeSanitize, remarkGfm]}
/>
);
} else {
Expand Down
4 changes: 4 additions & 0 deletions vendor-bundles.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const config = {
'react-select1',
'igv',
'jstat',
'react-markdown',
'rehype-raw',
'rehype-sanitize',
'remark-gfm',
],
},

Expand Down
Loading

0 comments on commit 563926c

Please sign in to comment.