This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,6 @@ function isAllowedHtmlTag(node: commonmark.Node): boolean {
56
56
function isMultiLine ( node : commonmark . Node ) : boolean {
57
57
let par = node ;
58
58
while ( par . parent ) {
59
- // commonmark Parser separate quotes with blank quoted lines between them with
60
- // paragraphs, so we need to consider it when the markdown is only a multiline quote.
61
- if ( par . type === 'block_quote' ) {
62
- break ;
63
- }
64
-
65
59
par = par . parent ;
66
60
}
67
61
return par . firstChild != par . lastChild ;
@@ -135,7 +129,10 @@ export default class Markdown {
135
129
// 'inline', rather than unnecessarily wrapped in its own
136
130
// p tag. If, however, we have multiple nodes, each gets
137
131
// its own p tag to keep them as separate paragraphs.
138
- if ( isMultiLine ( node ) ) {
132
+ // However, if it's a blockquote, adds a p tag anyway
133
+ // in order to avoid deviation to commonmark and unexpected
134
+ // results when parsing the formatted HTML.
135
+ if ( node . parent . type === 'block_quote' || isMultiLine ( node ) ) {
139
136
realParagraph . call ( this , node , entering ) ;
140
137
}
141
138
} ;
You can’t perform that action at this time.
0 commit comments