Emphasis border rule, and caller-supplied TODO/DONE colors !4

merged merged by cmc on 2026-08-31 18:32 UTC · krz/org-swift:org-fixes into main

Discussion

cmc

Emphasis border rule

An emphasis body may not begin or end with whitespace. Only the character after the closing marker was checked, so

=ssh.mode = "system"= to run under it

closed the verbatim at the middle = and rendered as two spans with the quoted value loose between them. The closer is now required to sit against a non-whitespace character, and an opener followed by whitespace no longer opens.

Affected both renderers, since they share the parse. Corpus conformance is unchanged at 11/12.

Keyword colors

The renderer hardcoded green for DONE and orange for TODO. Everything else it draws is semantic and inherits the embedding app's appearance; those two were concrete hues matching no palette. OrgKeywordStyle carries them and defaults to semantic, so the package invents nothing:

OrgView(source, keywords: OrgKeywordStyle(todo: .gbOK, done: .gbDone))

OrgRenderOptions stays Foundation-only, so this lives in OrgSwiftUI.

78 tests green.