Skip to content

Commit

Permalink
fix: Markdown incorrectly rendering inline code blocks
Browse files Browse the repository at this point in the history
- Fixes #2312
- Tested using a code block from the ticket
  • Loading branch information
mofojed committed Jan 16, 2025
1 parent 5f6c8d6 commit 3630882
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ interface MarkdownEditorProps {
}

const renderMarkdown: CodeComponent = props => {
const { children, className } = props;
const { children, inline, className } = props;
if (inline === true) {
return (
<code>
{React.Children.map(children, child =>
typeof child === 'string' ? child.trim() : child
)}
</code>
);
}
const language =
className !== undefined && className?.startsWith('language-')
? className.substring(9)
Expand Down

0 comments on commit 3630882

Please sign in to comment.