Fix two rendering bugs found integrating OrgSwiftUI !3

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

Discussion

cmc

Both found rendering krz/gitbay's README.org in the gitbay-ios app, which is the first real consumer of the native renderer.

Every run now carries its block's font. The styler set a font only on runs it modified, so a run with no emphasis carried none and inherited whatever font the surrounding view had. Headings rendered at body size and weight; so did table cells, footnotes and captions. Headings are also bold now, matching what the HTML renderer gets from h1-h6.

The layout rebuilds when the color scheme changes. An OrgCodeStyler bakes its theme's colors into the AttributedString it returns, so a layout built in light mode kept light-theme code after a switch to dark — dark grey on a dark background. The task now keys on the color scheme as well as the source.

76 tests green, with a new one asserting every run carries a font.

Verified on the simulator against krz/gitbay's README in both appearances: headings render large and bold, and the code block picks up atom-one-dark after switching.