Run artifact

workspace/targets/commonmark/blueprint/FEATURE-Block-Quotes.md

FEATURE: Block Quotes

FieldValue
Version20261014 V1
DescriptionParse block quotes with marker handling, lazy continuation and the blank-line consecutiveness rule.
Depends OnFEATURE-HTML-Blocks.md
Providesblock quote container
Consumesblock-type registry, lazy continuation check

Purpose

Implement the Block quotes section of the spec as a registered container block.

Rules

Reads

Writes

Programmatic Acceptance

The corpus section has examples that use lists, so it is gated in the lists story. The checks here are bounded.

=== AC quote-basic-content ===
Intent: A quote with a heading and paragraph lines renders one blockquote containing one h1 and one paragraph.

import subprocess

result = subprocess.run(["./commonmark"], input="> # Foo\n> bar\n> baz\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 1 assert result.stdout.count("<h1>") == 1 assert result.stdout.count("<p>") == 1 === END AC quote-basic-content ===

=== AC quote-marker-space-optional ===
Intent: The space after the marker is optional, and up to three spaces of indentation are allowed.

import subprocess

for source in ("># Foo\n>bar\n", " > # Foo\n > bar\n"): result = subprocess.run(["./commonmark"], input=source, capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 1 assert result.stdout.count("<h1>") == 1 === END AC quote-marker-space-optional ===

=== AC quote-lazy-continuation ===
Intent: An unmarked paragraph continuation line stays in the quote's paragraph.

import subprocess

result = subprocess.run(["./commonmark"], input="> bar\nbaz\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 1 assert result.stdout.count("<p>") == 1 === END AC quote-lazy-continuation ===

=== AC quote-nested-lazy ===
Intent: Omitted markers on a nested quote's continuation line still keep three nesting levels and one paragraph.

import subprocess

result = subprocess.run(["./commonmark"], input="> > > foo\nbar\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 3 assert result.stdout.count("<p>") == 1 === END AC quote-nested-lazy ===

=== AC quote-blank-line-separates ===
Intent: A blank line separates two quotes, and adjacent marked lines form one quote.

import subprocess

separated = subprocess.run(["./commonmark"], input="> foo\n\n> bar\n", capture_output=True, text=True) joined = subprocess.run(["./commonmark"], input="> foo\n> bar\n", capture_output=True, text=True) print(separated.stdout) print(joined.stdout) assert separated.returncode == 0 assert joined.returncode == 0 assert separated.stdout.count("<blockquote>") == 2 assert joined.stdout.count("<blockquote>") == 1 === END AC quote-blank-line-separates ===

=== AC quote-interrupts-paragraph ===
Intent: A quote interrupts a paragraph, leaving one paragraph before it and one inside it.

import subprocess

result = subprocess.run(["./commonmark"], input="foo\n> bar\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 1 assert result.stdout.count("<p>") == 2 === END AC quote-interrupts-paragraph ===

=== AC quote-four-spaces-is-code ===
Intent: Four spaces before the marker make an indented code block, not a quote.

import subprocess

result = subprocess.run(["./commonmark"], input=" > foo\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 0 assert result.stdout.count("<pre>") == 1 === END AC quote-four-spaces-is-code ===

=== AC quote-no-lazy-code ===
Intent: Laziness does not apply to indented code, so the unmarked indented line becomes its own code block.

import subprocess

result = subprocess.run(["./commonmark"], input="> foo\n bar\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<blockquote>") == 1 assert result.stdout.count("<pre>") == 2 === END AC quote-no-lazy-code ===

User Acceptance

Guardrails