Problem
There is no way to control line spacing per paragraph style. The only lever is the container style.lineHeight, which is global and exists on EnrichedTextInput only. Two consequences:
1. Read-only rendering can't do line spacing at all.
EnrichedTextInputNativeComponent.ts:401 declares lineHeight; EnrichedTextNativeComponent.ts declares none. Because EnrichedTextProps.style is typed as RN TextStyle, TypeScript happily accepts lineHeight and it is dropped before native — silently, with no warning.
On iOS EnrichedTextView.mm:616 reads scaledPrimaryLineHeight, but nothing ever calls setPrimaryLineHeight for that view (only EnrichedTextInputView.mm:234 does). On Android enriched/text/ has no EnrichedLineHeightSpan at all.
An app that edits with EnrichedTextInput and renders with EnrichedText therefore cannot make the two views match.
2. The global value behaves differently per platform.
Android's EnrichedLineHeightSpan.chooseHeight returns early for headings (EnrichedLineHeightSpan.kt:35), while iOS applies minimumLineHeight to every paragraph range (EnrichedTextInputView.mm:902-918).
For headings above the value this is invisible, but a heading whose natural leading falls below it diverges — with the default htmlStyle, h4/h5/h6 (16/14/12px) all sit under a typical body lineHeight of 24, so they open up on iOS and stay tight on Android.
Proposal
Accept lineHeight per tag in htmlStyle — p, li, h1–h6, blockquote, codeblock — honored by both EnrichedText and EnrichedTextInput.
This is the direction the code already anticipates. EnrichedLineHeightSpan.kt:34 carries the comment:
In the future we may consider adding custom lineHeight support for each paragraph style
It also subsumes issue 1 without needing style.lineHeight parity on EnrichedText, since htmlStyle is already wired to both components, and it makes the heading question explicit per tag rather than an implicit platform difference.
Use case
A notes app where the editor and a read-only view render the same HTML and must look identical.
Version: 1.0.1
Problem
There is no way to control line spacing per paragraph style. The only lever is the container
style.lineHeight, which is global and exists onEnrichedTextInputonly. Two consequences:1. Read-only rendering can't do line spacing at all.
EnrichedTextInputNativeComponent.ts:401declareslineHeight;EnrichedTextNativeComponent.tsdeclares none. BecauseEnrichedTextProps.styleis typed as RNTextStyle, TypeScript happily acceptslineHeightand it is dropped before native — silently, with no warning.On iOS
EnrichedTextView.mm:616readsscaledPrimaryLineHeight, but nothing ever callssetPrimaryLineHeightfor that view (onlyEnrichedTextInputView.mm:234does). On Androidenriched/text/has noEnrichedLineHeightSpanat all.An app that edits with
EnrichedTextInputand renders withEnrichedTexttherefore cannot make the two views match.2. The global value behaves differently per platform.
Android's
EnrichedLineHeightSpan.chooseHeightreturns early for headings (EnrichedLineHeightSpan.kt:35), while iOS appliesminimumLineHeightto every paragraph range (EnrichedTextInputView.mm:902-918).For headings above the value this is invisible, but a heading whose natural leading falls below it diverges — with the default
htmlStyle, h4/h5/h6 (16/14/12px) all sit under a typical bodylineHeightof 24, so they open up on iOS and stay tight on Android.Proposal
Accept
lineHeightper tag inhtmlStyle—p,li,h1–h6,blockquote,codeblock— honored by bothEnrichedTextandEnrichedTextInput.This is the direction the code already anticipates.
EnrichedLineHeightSpan.kt:34carries the comment:It also subsumes issue 1 without needing
style.lineHeightparity onEnrichedText, sincehtmlStyleis already wired to both components, and it makes the heading question explicit per tag rather than an implicit platform difference.Use case
A notes app where the editor and a read-only view render the same HTML and must look identical.
Version: 1.0.1