diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx
index 634236ef..0c1e2c0c 100644
--- a/src/components/rich_content/rich_content.jsx
+++ b/src/components/rich_content/rich_content.jsx
@@ -124,6 +124,14 @@ export default {
}
const renderMisskeyMarkdown = (content) => {
+ // Untangle code blocks from
tags
+ const codeblocks = content.match(/(
)?(~~~|```)\w*
.+?
\2\1?/g)
+ if (codeblocks) {
+ codeblocks.forEach((pre) => {
+ content = content.replace(pre, pre.replaceAll('
', '\n'))
+ })
+ }
+
marked.use(markedMfm, {
mangle: false,
gfm: false,