markdown icon indicating copy to clipboard operation
markdown copied to clipboard

nested blockquotes

Open nathan-fiscaletti opened this issue 6 years ago • 5 comments

> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.

results in:

<blockquote>
<p>Blockquotes can also be nested&hellip;
&gt; &hellip;by using additional greater-than signs right next to each other&hellip;
&gt; &gt; &hellip;or with spaces between arrows.</p>
</blockquote>

nathan-fiscaletti avatar Jan 27 '20 05:01 nathan-fiscaletti

[ Quoting [email protected] in "[gomarkdown/markdown] nested blockq..." ]

> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.

results in:

<blockquote>
<p>Blockquotes can also be nested&hellip;
&gt; &hellip;by using additional greater-than signs right next to each other&hellip;
&gt; &gt; &hellip;or with spaces between arrows.</p>
</blockquote>

This needs to be:

> Blockquotes can also be nested
>
>> by using additional greater-than signs right next to each other
>>
>>> or with spaces between arrows.

miekg avatar Jan 27 '20 11:01 miekg

[ Quoting [email protected] in "[gomarkdown/markdown] nested blockq..." ] > Blockquotes can also be nested... >> ...by using additional greater-than signs right next to each other... > > > ...or with spaces between arrows. results in: <blockquote> <p>Blockquotes can also be nested&hellip; &gt; &hellip;by using additional greater-than signs right next to each other&hellip; &gt; &gt; &hellip;or with spaces between arrows.</p> </blockquote> This needs to be: ~~~ Blockquotes can also be nested > by using additional greater-than signs right next to each other > >> or with spaces between arrows.

[ Quoting <[email protected]> in "[gomarkdown/markdown] nested blockq..." ]
``` > Blockquotes can also be nested... >> ...by using additional greater-than signs right next to each other... > > > ...or with spaces between arrows. ``` results in: ``` <blockquote> <p>Blockquotes can also be nested&hellip; &gt; &hellip;by using additional greater-than signs right next to each other&hellip; &gt; &gt; &hellip;or with spaces between arrows.</p> </blockquote> ```
This needs to be: ~~~
Blockquotes can also be nested > by using additional greater-than signs right next to each other > >> or with spaces between arrows.

This text, here on github:

> Blockquotes can also be nested...
>> ...by using additional greater-than signs right next to each other...
> > > ...or with spaces between arrows.

results in this:

Blockquotes can also be nested...

...by using additional greater-than signs right next to each other...

...or with spaces between arrows.

The example you gave above seems to not have worked at all on github?

nathan-fiscaletti avatar Jan 27 '20 15:01 nathan-fiscaletti

what has github's markdown parser to do with this issue?

miekg avatar Feb 15 '20 06:02 miekg

According to babelmark majority of parsers do nested blockqutoe:

https://babelmark.github.io/?text=%3E+Blockquotes+can+also+be+nested...%0A%3E%3E+...by+using+additional+greater-than+signs+right+next+to+each+other...%0A%3E+%3E+%3E+...or+with+spaces+between+arrows.

Would be good to have that too, although probably not trivial to implement.

kjk avatar Sep 18 '21 22:09 kjk

Looked a bit at the code, certainly not trivial. Current code does process the quoteblock again, but this start at the start of Blockquotes can also be nested..., on that it will assert quotePrefix which fails because it starts with a B, the prefix will then not be checked again any we go into the paragraph case, where all remaining text is swept up into a <p>.

https://github.com/gomarkdown/markdown/blob/master/parser/block.go#L1071 is where we actually detect that second prefix.

Fixing this is pretty involved.

miekg avatar Nov 05 '21 14:11 miekg