Skip to content

Commit

Permalink
Merge pull request #689 from sudhanshutech/pre/tag
Browse files Browse the repository at this point in the history
Fix `pre` tag of html and its theme
  • Loading branch information
sudhanshutech committed Jul 24, 2024
2 parents 8b0631d + c67ed11 commit 186a132
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/custom/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
StyledMarkdownH6,
StyledMarkdownLi,
StyledMarkdownP,
StyledMarkdownPre,
StyledMarkdownTd,
StyledMarkdownTh,
StyledMarkdownTooltipP,
Expand Down Expand Up @@ -51,7 +52,8 @@ export const RenderMarkdown: React.FC<RenderMarkdownProps> = ({ content }) => {
ul: ({ ...props }) => <StyledMarkdownUl>{props.children}</StyledMarkdownUl>,
li: ({ ...props }) => <StyledMarkdownLi>{props.children}</StyledMarkdownLi>,
th: ({ ...props }) => <StyledMarkdownTh>{props.children}</StyledMarkdownTh>,
td: ({ ...props }) => <StyledMarkdownTd>{props.children}</StyledMarkdownTd>
td: ({ ...props }) => <StyledMarkdownTd>{props.children}</StyledMarkdownTd>,
pre: ({ ...props }) => <StyledMarkdownPre>{props.children}</StyledMarkdownPre>
}}
>
{content}
Expand Down
5 changes: 5 additions & 0 deletions src/custom/Markdown/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,8 @@ export const StyledMarkdownTd = styled('td')(({ theme }) => ({
marginBlock: '0px',
...theme.typography.textB1Regular
}));

export const StyledMarkdownPre = styled('pre')(({ theme }) => ({
background: theme.palette.background.code,
whiteSpace: 'pre-line'
}));

0 comments on commit 186a132

Please sign in to comment.