blackfriday icon indicating copy to clipboard operation
blackfriday copied to clipboard

Consecutive blockquotes rendered as one blockquote

Open alexherbo2 opened this issue 5 years ago • 3 comments

Example

> Blockquote 1:
> Some text.

> Blockquote 2:
> Some text.

Blackfriday renders it as: one blockquote.

Blockquote 1: Some text.

Blockquote 2: Some text.

Instead of: two blockquotes.

Blockquote 1: Some text.

Blockquote 2: Some text.

alexherbo2 avatar Mar 15 '19 22:03 alexherbo2

See if this fits your use case.

> Blockquote 1:
> Some text.

<!-- -->

> Blockquote 2:
> Some text.

askmrsinh avatar Apr 13 '19 21:04 askmrsinh

Issue confirmed: this behavior seems to violate Markdown standards. I found the problematic code here in block.go:

		if pre := p.quotePrefix(data[beg:]); pre > 0 {
			// skip the prefix
			beg += pre
		} else if p.terminateBlockquote(data, beg, end) {
			break
		}

that function terminateBlockquote swallows lines and data into blockquote buggily - it will even eat a unprefixed plain text node or even an <hr />. To fix I replaced one line by removing the call to terminateBlockquote altogether. So that result is:

		if pre := p.quotePrefix(data[beg:]); pre > 0 {
			// skip the prefix
			beg += pre
		// } else if p.terminateBlockquote(data, beg, end) {
		} else {
			break
		}

Can somebody double check this and push an update?

dkotik avatar Jun 16 '19 14:06 dkotik

Would love to get that fixed, drives me crazy and workarounds poison the markdown.

arvenil avatar Jan 24 '21 15:01 arvenil