From 3db7551ad356a40562864aa2afd3dd645084a51d Mon Sep 17 00:00:00 2001 From: Johann150 Date: Fri, 5 Nov 2021 03:54:26 +0100 Subject: [PATCH] fix html conversion issue with code blocks (#7943) --- src/mfm/from-html.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mfm/from-html.ts b/src/mfm/from-html.ts index 14279f338..de6aa3d0c 100644 --- a/src/mfm/from-html.ts +++ b/src/mfm/from-html.ts @@ -147,7 +147,7 @@ export function fromHtml(html: string, hashtagNames?: string[]): string | null { // block code (
)
 			case 'pre': {
 				if (node.childNodes.length === 1 && node.childNodes[0].nodeName === 'code') {
-					text += '```\n';
+					text += '\n```\n';
 					text += getText(node.childNodes[0]);
 					text += '\n```\n';
 				} else {