Skip to content

Commit

Permalink
Merge pull request #666 from sudhanshutech/html/support
Browse files Browse the repository at this point in the history
Html tag support in markdown component
  • Loading branch information
aabidsofi19 authored Jul 4, 2024
2 parents cff50a2 + 349a505 commit 369d3ea
Show file tree
Hide file tree
Showing 3 changed files with 272 additions and 0 deletions.
269 changes: 269 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"prettier-plugin-organize-imports": "^3.2.3",
"react-error-boundary": "^4.0.12",
"react-markdown": "^8.0.7",
"rehype-raw": "^6.1.1",
"remark-gfm": "^3.0.1",
"ts-jest": "^29.1.1",
"tsup": "^8.0.1",
Expand Down
2 changes: 2 additions & 0 deletions src/custom/Markdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm';
import {
StyledMarkdown,
Expand All @@ -24,6 +25,7 @@ export const RenderMarkdown: React.FC<RenderMarkdownProps> = ({ content }) => {
return (
<ReactMarkdown
remarkPlugins={[remarkGfm]}
rehypePlugins={[rehypeRaw]}
components={{
p: ({ ...props }) => <StyledMarkdownP>{props.children}</StyledMarkdownP>,
a: ({ ...props }) => (
Expand Down

0 comments on commit 369d3ea

Please sign in to comment.