Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested blockquotes #149

Open
nathan-fiscaletti opened this issue Jan 27, 2020 · 5 comments
Open

nested blockquotes #149

nathan-fiscaletti opened this issue Jan 27, 2020 · 5 comments

Comments

@nathan-fiscaletti
Copy link

> 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>
@miekg
Copy link
Collaborator

miekg commented Jan 27, 2020 via email

@nathan-fiscaletti
Copy link
Author

[ Quoting notifications@github.com 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 <notifications@github.com> 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?

@miekg
Copy link
Collaborator

miekg commented Feb 15, 2020

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

@kjk
Copy link
Contributor

kjk commented Sep 18, 2021

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.

@miekg
Copy link
Collaborator

miekg commented Nov 5, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants