Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix multiline paragraph rendering as single line #7210

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix multiline paragraph rendering as single line
Signed-off-by: Renan <[email protected]>
renancleyson-dev committed Nov 26, 2021
commit 72c4ff6ec7e8269b51a83a105206baf0ff626a4d
6 changes: 6 additions & 0 deletions src/Markdown.ts
Original file line number Diff line number Diff line change
@@ -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;