Run artifact

workspace/targets/commonmark/blueprint/FEATURE-Autolinks.md

FEATURE: Autolinks

FieldValue
Version20261014 V1
DescriptionParse URI autolinks and email autolinks inside angle brackets into links.
Depends OnFEATURE-Block-Engine.md
Providesautolink inline construct
Consumesinline parser hook, URL percent-encoding helper

Purpose

Implement the Autolinks section of the spec.

Rules

Reads

Writes

Programmatic Acceptance

=== AC autolinks-corpus-section ===
Intent: The Autolinks conformance section (19 cases) passes 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", "^Autolinks$", ], capture_output=True, text=True, env={**os.environ}, ) print(result.stdout) print(result.stderr, file=sys.stderr) assert result.returncode == 0 === END AC autolinks-corpus-section ===

=== AC autolinks-uri-roundtrip ===
Intent: A URI autolink renders as one link whose href and text are the supplied URI.

import subprocess

uri = "http://example.org/path" result = subprocess.run(["./commonmark"], input="<" + uri + ">\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<a ") == 1 assert ('href="' + uri + '"') in result.stdout assert (">" + uri + "</a>") in result.stdout === END AC autolinks-uri-roundtrip ===

=== AC autolinks-email-mailto ===
Intent: An email autolink renders with a mailto href built from the supplied address.

import subprocess

address = "someone@example.org" result = subprocess.run(["./commonmark"], input="<" + address + ">\n", capture_output=True, text=True) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<a ") == 1 assert ('href="mailto:' + address + '"') in result.stdout === END AC autolinks-email-mailto ===

=== AC autolinks-space-not-autolink ===
Intent: A URI containing a space is not an autolink, so no link element is produced.

import subprocess

result = subprocess.run( ["./commonmark"], input="<http://example.org/a b>\n", capture_output=True, text=True ) print(result.stdout) assert result.returncode == 0 assert result.stdout.count("<a ") == 0 === END AC autolinks-space-not-autolink ===

User Acceptance

Guardrails