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 {
5656function isMultiLine ( node : commonmark . Node ) : boolean {
5757 let par = node ;
5858 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-
6559 par = par . parent ;
6660 }
6761 return par . firstChild != par . lastChild ;
@@ -135,7 +129,10 @@ export default class Markdown {
135129 // 'inline', rather than unnecessarily wrapped in its own
136130 // p tag. If, however, we have multiple nodes, each gets
137131 // 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 ) ) {
139136 realParagraph . call ( this , node , entering ) ;
140137 }
141138 } ;
You can’t perform that action at this time.
0 commit comments