Blockquotes - whitespace after `>`

Hi,

In the spec it is mentioned that a blockquote doesn’t require a whitespace between the blockquote character > and the content of the blockquote (example 193).

Firstly, it makes a small inconsistency with Heading ATX that require a space (example 33).

Secondly, we come across a collision with textual smileys. For example, the smiley >_< are not parsed like a smiley but like a blockquote with the current commonMark spec.

So, the question is, this will be harmonized ?

Sincerly,

Heziode

I’m afraid there’s a lot of existing content out there
that would be broken if we required a space (though
aesthetically I’d be glad to do that).

2 Likes

That’s what I think …
Maybe in a major update (that include breaking changes).

“Commonmark Strict: how Markdown editors should write text markup”, a proper subset of the more permissive Commonmark 1.0

1 Like

This would be a good rule to add to a style guide for CommonMark. You could potentially run an auto-fixer on existing CommonMark documents to enforce the rule.

3 Likes

We should have changed the behavior together with prefixed, ATX headings, which broke, for instance, a lot of readmes on Github anyway.

I believe a compromise would make – or rather: would have made – most sense: a space or tabulator after the “bird track” is optional only if another line marker (#, *, -, +) or fence follows, otherwise whitespace is mandatory.

Quotations

>no blockquote!

> blockquote

>  blockquote

>   blockquote

>    blockquote

>     quoted code

   > indented blockquote

>>no blockquote

>> nested blockquote

> >blockquote

> > nested blockquote

Headings

ATX headings

># quoted top-level heading

> # quoted top-level heading

> #hashtag in blockquote

>## quoted second-level heading

> ## quoted second-level heading

># # quoted top-level heading

> # # quoted top-level heading

># #hashtag in quoted top-level heading

> # #hashtag in quoted top-level heading

Setext headings

> quoted heading
> ===

> quoted heading
>===

>no heading?
>===

>no heading?
> ===

List items

>- quoted list item

>* quoted list item

>+ quoted list item
>  - quoted list item
> - quoted list item
>- quoted list item

>- quoted list item
> - quoted list item

> - quoted list item
>  - quoted list item

> - quoted list item
>   - quoted nested list item

>- quoted list item
>  - quoted nested list item

Fences

> ~~~
> quoted code
> ~~~

> ```
> quoted code
> ```

>~~~
> quoted code starting with literal space?
>~~~

>```
> quoted code starting with literal space?
>```

>~~~
>quoted code starting with literal greater than sign?
>~~~

>```
>quoted code starting with literal greater than sign?
>```

Thematic breaks

>___

>---

>***

Optional blockquote suffix

By the way, I also believe that this should have been complemented by the introduction of an optional suffix < with the same whitespace rule in front of it:

> foo <

>> bar <<

> baz<

># heading #<
.
<blockquote>foo</blockquote>
<blockquote><blockquote>bar</blockquote></blockquote>
<blockquote>baz&lt;</blockquote>
<blockquote><h1>heading</h1></blockquote>

Generalization

However, if this rule was extended to other line-prefixed blocks as well, it could lead to surprising results:

-> blockquote in list item

+# heading in list item

**** fourth-level nested list item

# # heading nested in heading or second-level heading

PS: It had been suggested as an option for ATX headings to require a space only for the (rare) top level:

2 Likes

Indeed,

I agree the compromise.