Run artifact

workspace/targets/commonmark/blueprint/FEATURE-Code-Spans.md

FEATURE: Code Spans

FieldValue
Version20261014 V1
DescriptionParse code spans and establish the left-to-right inline scanner with code, autolink and raw HTML precedence.
Depends OnFEATURE-Autolinks.md, FEATURE-Raw-HTML.md
Providescode span inline construct, inline scanner loop
Consumesautolink inline construct, raw inline HTML construct

Purpose

Implement the Code spans and Inlines sections of the spec, and the inline scanner loop that later inline stories extend.

Rules

Reads

Writes

Programmatic Acceptance

The Precedence section needs lists and is gated in the lists story.

=== AC codespans-corpus-sections ===
Intent: The Code spans and Inlines conformance sections (23 cases) pass in full.
Suite: scoped
Probe: --dump-tests
Probe Count: lines

import os import subprocess import sys

result = subprocess.run( [ sys.executable, "sources/spec_tests.py", "--program", os.getcwd() + "/commonmark", "--spec", "sources/spec.txt", "--pattern", "^Code spans$|^Inlines$", ], capture_output=True, text=True, env={**os.environ}, ) print(result.stdout) print(result.stderr, file=sys.stderr) assert result.returncode == 0 === END AC codespans-corpus-sections ===

=== AC codespans-simple ===
Intent: A single-backtick span renders one code element containing the supplied content.

import subprocess

content = "some code" result = subprocess.run(["./commonmark"], input="" + content + "\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<code>") == 1 assert content in result.stdout === END AC codespans-simple ===

=== AC codespans-backtick-length-match ===
Intent: A double-backtick span may contain a single backtick, which is kept inside one code element.

import subprocess

inner = "ab" result = subprocess.run(["./commonmark"], input="" + inner + "`\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<code>") == 1 assert inner in result.stdout === END AC codespans-backtick-length-match ===

=== AC codespans-unclosed-literal ===
Intent: An unmatched backtick run is literal text and produces no code element.

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("<code>") == 0 === END AC codespans-unclosed-literal ===

=== AC codespans-escapes-inert ===
Intent: A backslash inside a code span is kept literally.

import subprocess

content = "\\[" result = subprocess.run(["./commonmark"], input="" + content + "\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<code>") == 1 assert content in result.stdout === END AC codespans-escapes-inert ===

User Acceptance

Guardrails