Fenced blockquote

Allow this syntax

>>>
quoting a parent, and their code

~~~
class Foo {
}
~~~

is still part of the quote
>>>

or this

>>>
hello world

my name is hal
>>>

would generate

<blockquote>
   <p>hello world</p>
   <p>my name is hal</p>
</blockquote>

it’s fundamentaly equivalent to just writing

> hello world

> my name is hal

which of course is simple enough in that use case but if you were copying multiple paragraphs from an alternate source in a tiny web text editor, it might be hard to go back and add > at the correct points.

I could swear I’ve done this in an existing markdown implementation, but I’m not sure which one. I wouldn’t mind if this were part of the core spec, but I’m assuming that maybe things need to be extensions first?

3 Likes

Just for the record, this is (or used to be) supported on Gitlab and was apparently inherited from Redcarpet which is a Ruby binding of Sundown which was based upon Upskirt alias libsoldout, although I cannot find this syntax extension mentioned in the documentation of any of them. Also, no implementation featured in Babelmark 2 or 3 handles this as proposed (at least without an optional extension).

1 Like

I’ve added the proposed alternative syntax extensions to the list of proposed extensions.

I think this would be a useful extension for authors who quote long sections of text. However, a good editor could add or remove the > character to/from the start of every paragraph with a keyboard shortcut. This is arguably more readable than scrolling up to find the start of a large block (which could cover several pages). Perhaps effort should be directed at enhancing editors instead? Given that the existing blockquote syntax is already supported by every implementation, that might be preferable.

GitLab Flavored Markdown still supports fenced blockquotes.

It would be awesome to have a dedicated extension (implemented in Pandoc) to properly support conversion to/from GitLab Flavored Markdown.

Having just independently “invented” fenced blockquotes (“invented” is a bit of a bold claim, as it seems like quite an obvious syntax given that fenced code blocks already exist), this seems like a good idea.

In particular, I’d like to see the ability to optionally specify a source URL to go in the cite attribute.

For example:

>>> https://en.wikipedia.org/wiki/Markdown
From 2012, a group of people, including Jeff Atwood and John MacFarlane, launched what Atwood characterized as a standardization effort.

A community website now aims to "document various tools and resources available to document authors and developers, 
as well as implementors of the various Markdown implementations".
>>>
<blockquote cite="https://en.wikipedia.org/wiki/Markdown">
<p>From 2012, a group of people, including Jeff Atwood and John MacFarlane, launched what Atwood characterized as a standardization effort.</p>
<p>A community website now aims to "document various tools and resources available to document authors and developers, 
as well as implementors of the various Markdown implementations".</p>
</blockquote>

One use case for this is quoting passages copied from PDFs, where newlines can be inserted amongst the text.

Having realised that >>> is indistinguishable from a block quote nested 3 levels deep (at least without the introduction of a rule that takes into account the surrounding lines as context), I’ve switched to using <<< instead.

This has the added benefit of implying transclusion from the source URL:

<<< https://en.wikipedia.org/wiki/Markdown
From 2012, a group of people, including Jeff Atwood and John MacFarlane, launched what Atwood characterized as a standardization effort.

A community website now aims to "document various tools and resources available to document authors and developers, 
as well as implementors of the various Markdown implementations".
<<<

One useful addition might be to allow a title for the source, in regular link format, in case it’s useful to display a link to the source in the output:

<<< [Markdown](https://en.wikipedia.org/wiki/Markdown)
From 2012, a group of people, including Jeff Atwood and John MacFarlane, launched what Atwood characterized as a standardization effort.

A community website now aims to "document various tools and resources available to document authors and developers, 
as well as implementors of the various Markdown implementations".
<<<