Run artifact

workspace/targets/commonmark/blueprint/FEATURE-Thematic-Breaks.md

FEATURE: Thematic Breaks

FieldValue
Version20261014 V1
DescriptionParse thematic breaks of three or more matching -, _ or * characters and render them as hr elements.
Depends OnFEATURE-Line-Breaks-Text.md
Providesthematic break block
Consumesblock-type registry

Purpose

Implement the Thematic breaks section of the spec as a registered block start rule.

Rules

Reads

Writes

Programmatic Acceptance

The corpus section needs lists, setext headings and emphasis, so it is gated in the lists story. The checks here are bounded.

=== AC thematic-three-markers ===
Intent: Lines of three or more matching marker characters each render one hr element.

import subprocess

lines = ["***", "---", "_", "___", " - - -", " ** * ** * ** * **"] source = "\n\n".join(lines) + "\n" result = subprocess.run(["./commonmark"], input=source, capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<hr />") == len(lines) === END AC thematic-three-markers ===

=== AC thematic-not-a-break ===
Intent: Wrong characters, too few characters, mixed characters and trailing text do not produce hr elements.

import subprocess

source = "+++\n\n--\n\n_ _ _ _ a\n\na------\n\n -\n" result = subprocess.run(["./commonmark"], input=source, capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<hr />") == 0 === END AC thematic-not-a-break ===

=== AC thematic-interrupts-paragraph ===
Intent: A thematic break directly after paragraph text splits it into two paragraphs around one hr.

import subprocess

result = subprocess.run(["./commonmark"], input="Foo\n***\nbar\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<hr />") == 1 assert result.stdout.count("<p>") == 2 === END AC thematic-interrupts-paragraph ===

=== AC thematic-trailing-whitespace ===
Intent: Trailing spaces and tabs after the marker characters are allowed.

import subprocess

result = subprocess.run(["./commonmark"], input="- - - - \t\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<hr />") == 1 === END AC thematic-trailing-whitespace ===

User Acceptance

Guardrails