fix html conversion issue with code blocks (#7943)

This commit is contained in:
Johann150 2021-11-05 03:54:26 +01:00 committed by GitHub
parent 37b535df30
commit 3db7551ad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ export function fromHtml(html: string, hashtagNames?: string[]): string | null {
// block code (<pre><code>) // block code (<pre><code>)
case 'pre': { case 'pre': {
if (node.childNodes.length === 1 && node.childNodes[0].nodeName === 'code') { if (node.childNodes.length === 1 && node.childNodes[0].nodeName === 'code') {
text += '```\n'; text += '\n```\n';
text += getText(node.childNodes[0]); text += getText(node.childNodes[0]);
text += '\n```\n'; text += '\n```\n';
} else { } else {