# 0011 — Apex HTML reading pipeline Reading mode renders markdown through apex (MIT, unified dialect) as an HTML fragment loaded into a single WKWebView styled by our CSS — typography slots become CSS custom properties, and a blank-line-chunked `data-source-line` stamp (sentinel HTML comments, applied post-conversion; apex emits no source positions) carries the click-to-edit and scroll-sync map at paragraph granularity. Proven live in the #74 spike (PERF-3k: ~18 ms apex, 33 ms end-to-end, zero mis-stamps corpus-wide); ruled in #73. Supersedes ADR-0010's reading stance — its editing stance (TextKit2 mode B) stands — and records ADR-0001's boundary as ruled: native-only governs the editing side; reading is presentation, so WKWebView is allowed. ## Considered Options - **TextKit reading renderer (#71 build)** — deleted, not kept as fallback: fallbacks rot, and its stale-flow defect dies unfixed by design. The decoupling obligation (editing side up to par as a plain-text surface) is ticketed separately (#77). - **`loadFileURL` instead of `loadHTMLString`** — 4× first paint (255 ms vs ~67 ms) from sandbox negotiation; `--embed-images` base64 inlining needs no file access at all and writes nothing into the vault. ## Consequences - **Bundling:** the prebuilt apex binary ships in app resources, signed + notarized. No source build in CI, no user install gate — a renderer must not grow a gate. - **One WKWebView, reloaded in place.** Remounting per document (`.id(sel)`) was the dominant switch cost — hundreds of ms of web-process respawn; `loadHTMLString` on a retained view feels instant. - **`--no-mixed-lists` is required**, not tuning: apex's default merges an ordered list following a bullet list into one `