Add BlockQuoteDivExtension (::: > fenced blockquote)#250
Open
dereuromark wants to merge 4 commits into
Open
Conversation
A :::-div whose only token is > produces a semantic <blockquote> without a
per-line > marker, the fenced analog of the ::: | line block. This lets a quote
own block content (lists, nested fences, tables) where the >-prefix form needs
the marker on every line, since lazy continuation folds only plain paragraph
text into a quote, never new block structure.
Caption (^ after the close fence) and figure wrapping reuse the core caption
handler; preceding {...} attributes attach to the blockquote (consumed before
the body is parsed so an inner block cannot claim them); longer colon runs nest.
Opt-in, no core parser change.
::: > fenced blockquote)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #250 +/- ##
============================================
+ Coverage 92.37% 92.42% +0.04%
- Complexity 3576 3588 +12
============================================
Files 107 108 +1
Lines 10129 10176 +47
============================================
+ Hits 9357 9405 +48
+ Misses 772 771 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an opt-in
BlockQuoteDivExtension: a:::div whose only token is>produces a semantic<blockquote>, the fenced analog of the existing::: |line block.The verbose
>-prefix form produces the identical output, but needs the marker on every line - the prose line, the blank separator, and each list item:The two are interchangeable; the fenced form just drops the per-line
>. The gap grows with the content - a quote wrapping a fenced code block or a table needs a>on every one of those lines too.Why
The
>-prefix block quote is comfortable for prose, where lazy continuation lets you drop the marker on wrapped lines. It is not comfortable when the quote contains block structure (a list, a nested fence, a table), because lazy continuation folds only plain paragraph text into a quote, never new block structure. Every list item and nested block then needs its own>, which is tedious to write and error-prone to edit.The fenced form removes the per-line marker while keeping identical semantics. It mirrors the language-neutral design of the
::: |line block: a single sigil on the opener, no English keyword, no per-line prefix. Distinct from::: quote, which stays an<aside class="admonition quote">rather than a semantic blockquote.Behavior
>-prefix form:<blockquote>.^ attributionline right after the closing:::wraps the quote in<figure>/<figcaption>, reusing the core caption handler.{...}block attaches to the<blockquote>(consumed before the body is parsed, so an inner block cannot claim it; with a caption the attributes transfer onto the<figure>).Design note
No core parser change. Because
>is not a meaningful class, a block-pattern hook intercepts the::: >opener, collects the inner lines with the standard div-closer detection, and parses them as block content into aBlockQuotenode, exactly the property that let::: |ship as an extension.Docs
docs/extensions/index.md- availability table row + aBlockQuoteDivExtensionsection.docs/guide/syntax.md- pointer from the block-quote section.docs/reference/enhancements.md- enhancement entry + feature-table row beside the line block.