Skip to content

Commit

Permalink
Add remark gfm
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Oct 5, 2023
1 parent 66c626a commit b031467
Show file tree
Hide file tree
Showing 3 changed files with 578 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
"react-responsive": "^8.2.0",
"react-simplemde-editor": "^4.0.1",
"react-tooltip": "^4.2.19",
"remark-gfm": "^4.0.0",
"sanitize-html": "^2.10.0",
"sass": "^1.26.10",
"store": "^2.0.12",
Expand Down
3 changes: 2 additions & 1 deletion src/components/utils/DfMd.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import ReactMarkdown from 'react-markdown'
import gfm from 'remark-gfm'

interface Props {
source?: string
className?: string
}

export const DfMd = ({ source, className = '' }: Props) => (
<ReactMarkdown className={`markdown-body ${className}`} linkTarget='_blank'>
<ReactMarkdown plugins={[gfm]} className={`markdown-body ${className}`} linkTarget='_blank'>
{source?.replaceAll('(https://app.subsocial.network/ipfs', '(https://ipfs.subsocial.network') ??
''}
</ReactMarkdown>
Expand Down
Loading

0 comments on commit b031467

Please sign in to comment.