Fix multiline paragraph rendering as single line (#7210)

pull/21833/head
Renan Cleyson 2021-11-29 07:47:35 -03:00 committed by GitHub
parent 35d4ec6e80
commit d939e45d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,12 @@ function isAllowedHtmlTag(node: commonmark.Node): boolean {
function isMultiLine(node: commonmark.Node): boolean {
let par = node;
while (par.parent) {
// commonmark Parser separate quotes with blank quoted lines between them with
// paragraphs, so we need to consider it when the markdown is only a multiline quote.
if (par.type === 'block_quote') {
break;
}
par = par.parent;
}
return par.firstChild != par.lastChild;