You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add list.markerWidth for aligning unordered, ordered, and task lists
Today each list type reserves its own natural marker column width — the
bullet radius (`bulletSize / 2`) for unordered, the width of `"99."` at
the marker font for ordered, and the checkbox size for tasks. Mixed
lists therefore look ragged: bullets and task boxes hang far to the left
of numbers.
The new optional `list.markerWidth` acts as a floor applied to all three
list types. Each list's effective column becomes `max(markerWidth,
natural)`, so consumers can widen the gutter uniformly without shrinking
ordered lists or resizing bullet/checkbox glyphs. Values below the
natural width are ignored.
```tsx
<EnrichedMarkdownText
markdownStyle={{
list: {
bulletSize: 6,
markerWidth: 22, // widens UL and task rows to match OL at 17pt
},
}}
...
/>
```
Implementation:
- Public `ListStyle.markerWidth?: number` (undefined = current
per-list-natural behavior).
- Internal codegen prop is a concrete `Float`; negative = "auto". Default
is set in `normalizeMarkdownStyle` so consumers never touch the
sentinel.
- iOS: `StyleConfig` now floors each list kind — new
`effectiveListMarginLeftForTask` plus updated
`effectiveListMarginLeftForBullet` / `effectiveListMarginLeftForNumber`.
`ListItemRenderer.m` routes the task case through the new accessor.
Wired through `StylePropsUtils` and included in the measurement cache
key so cached sizes invalidate when it changes.
- Android: `ListStyle.effectiveMarkerWidth(natural)` helper; each span
(`UnorderedListSpan`, `OrderedListSpan`, `TaskListSpan`) applies the
floor. Bullets and checkboxes now position themselves relative to the
reserved column's right edge so they line up flush with the gap —
behaviorally identical at the default since the column width equals
the natural glyph width.
- Docs: replaced the old bulletSize-only row in `docs/STYLES.md` with
the shared `markerWidth` semantics.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments