Skip to content

Commit

Permalink
fix: Markdown incorrectly rendering inline code blocks (#2342)
Browse files Browse the repository at this point in the history
- Fixes #2312
- Tested using a code block from the ticket

![image](https://github.com/user-attachments/assets/11adc367-c421-43a8-aadd-9de146a598ee)
  • Loading branch information
mofojed authored Jan 16, 2025
1 parent 3b5c7d3 commit f85c76f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $panel-container-padding: 10px;
code {
color: $foreground;
background: $gray-700;
padding: 2px $spacer-2;
padding: 0.2em;
border-radius: $border-radius;
border: 1px solid $black;
}
Expand Down

0 comments on commit f85c76f

Please sign in to comment.