Skip to content

Commit

Permalink
chore(website): correctly render escaped html in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Apr 22, 2022
1 parent 01ec1af commit 8a523cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/documentation/src/components/Markdown/renderers.tsx
@@ -1,5 +1,6 @@
import type { MarkdownRenderers } from "react-marked-renderer";
import {
EscapeRenderer,
DEFAULT_MARKDOWN_RENDERERS,
getTokensText,
ImageRenderer,
Expand Down Expand Up @@ -99,6 +100,15 @@ export const renderers: MarkdownRenderers = {
return <CodeBlock language={lang}>{text}</CodeBlock>;
},

escape: function Escape(props) {
// TODO: Remove after upgrading react-marked-renderer with this fix
if (props.text === "&lt;") {
return <>&lt;</>;
}

return <EscapeRenderer {...props} />;
},

listitem: function ListItem({ children }) {
return (
<Typography component="li" type="subtitle-1">
Expand Down

1 comment on commit 8a523cb

@vercel
Copy link

@vercel vercel bot commented on 8a523cb Apr 22, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

react-md – ./

react-md-mlaursen.vercel.app
react-md-git-main-mlaursen.vercel.app
react-md.dev
react-md-pi.vercel.app

Please sign in to comment.