Skip to content

Commit

Permalink
Bump react-markdown from 8.0.7 to 9.0.0 in /frontend (#1191)
Browse files Browse the repository at this point in the history
* Bump react-markdown from 8.0.7 to 9.0.0 in /frontend

Bumps [react-markdown](https://github.com/remarkjs/react-markdown) from 8.0.7 to 9.0.0.
- [Release notes](https://github.com/remarkjs/react-markdown/releases)
- [Changelog](https://github.com/remarkjs/react-markdown/blob/main/changelog.md)
- [Commits](remarkjs/react-markdown@8.0.7...9.0.0)

---
updated-dependencies:
- dependency-name: react-markdown
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Adjustments for removed props and ref type.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robin Tail <[email protected]>
  • Loading branch information
dependabot[bot] and RobinTail authored Oct 4, 2023
1 parent e82d99f commit a5d2aff
Show file tree
Hide file tree
Showing 3 changed files with 331 additions and 338 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@mui/lab": "^5.0.0-alpha.146",
"@mui/material": "^5.14.11",
"react-clipboard-button": "^2.0.0",
"react-markdown": "^8.0.7",
"react-markdown": "^9.0.0",
"react-router-dom": "^6.16.0",
"react-syntax-highlighter": "^15.5.0",
"react-telegram-auth": "^1.0.3",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,17 @@ export const CodeSnippet = ({ language, code }: CodeSnippetProps) => {
<ReactMarkdown
components={{
pre({ children }) {
return children;
return <>{children}</>;
},
code({ node, inline, className, children, style, ...props }) {
code({ node, className, children, style, ref, ...props }) {
const match = /language-(\w+)/.exec(className || "");
return !inline && match ? (
return match ? (
<SyntaxHighlighter
style={theme.palette.mode === "dark" ? atomDark : prism}
language={match[1]}
PreTag="div"
children={String(children).replace(/\n$/, "")}
ref={ref as React.LegacyRef<SyntaxHighlighter>}
{...props}
/>
) : (
Expand Down
Loading

1 comment on commit a5d2aff

@vercel
Copy link

@vercel vercel bot commented on a5d2aff Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.