- insertMarker and spliceSection normalized every line ending to LF, so a CRLF
DESIGN.md came back rewritten beyond the one line they promised to touch.
Both detect the file's dominant line ending and restore it.
- parseDesignMd and spliceSection each walked headings with their own fence
tracking; they now share headingLines (and upsertSection shares
headingMatches). An unclosed ``` is treated as prose for that file: it used
to swallow every later section on a splice.
- A token value carrying a control character (an LLM-extracted font family
with an embedded newline) was emitted as a bare multi-line scalar that
Bun.YAML rejects, turning a freshly written DESIGN.md into
frontmatter-unparsable; needsQuotes routes it through the quoted form.
- The marker-line regex variants are built once beside YAML_MARKER_RE; the
dead setMarker export and a no-op ternary are gone; LEGACY_HEADINGS derives
from the identity list; the header diagram names the text-level editors as
the write path for user-owned files; the bin validates and prints the mark
choices from FORMAT_CHOICES.
Tests: CRLF round-trips for both editors, a fenced ## inside a section and an
unclosed fence, and a newline-bearing scalar parsing back.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>