Run artifact

workspace/targets/commonmark/blueprint/FEATURE-Backslash-Escapes.md

FEATURE: Backslash Escapes

FieldValue
Version20261014 V1
DescriptionImplement backslash escapes of ASCII punctuation in text and expose a shared unescape helper for destinations, titles and info strings.
Depends OnFEATURE-Code-Spans.md
Providesbackslash escape inline rule, shared unescape helper
Consumesinline scanner loop

Purpose

Implement the Backslash escapes section of the spec.

Rules

Reads

Writes

Programmatic Acceptance

The Backslash escapes corpus section uses fenced code, links and definitions, so it is gated in the tabs story. The checks here are bounded.

=== AC escapes-punctuation-inert ===
Intent: An escaped asterisk prevents emphasis.

import subprocess

result = subprocess.run(["./commonmark"], input="\\not emphasized\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<em>") == 0 assert result.stdout.count("\\") == 0 === END AC escapes-punctuation-inert ===

=== AC escapes-non-punctuation-literal ===
Intent: A backslash before a non-punctuation character is kept as a literal backslash.

import subprocess

text = "\\A\\a\\3" result = subprocess.run(["./commonmark"], input=text + "\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert text in result.stdout === END AC escapes-non-punctuation-literal ===

=== AC escapes-block-markers ===
Intent: An escaped heading marker does not start a heading.

import subprocess

result = subprocess.run(["./commonmark"], input="\\# word\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<h1>") == 0 assert result.stdout.count("<p>") == 1 === END AC escapes-block-markers ===

=== AC escapes-inert-in-code-span ===
Intent: A backslash in a code span is not an escape.

import subprocess

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

User Acceptance

Guardrails