[Android] Leading and consecutive spaces are lost when HTML is parsed (iOS keeps them)
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- android, react-native
- 領域
- mobile
調査の方向性
Start with the EnrichedParser.characters() method, which drops spaces that follow another space or a newline, and with the Android serializer that writes a raw space at the start of a paragraph. Run the example app's test screen with <html><p> a b </p><p> c</p></html> to reproduce the difference from iOS. The issue asks the maintainers to choose between keeping whitespace on Android and writing on both platforms, so confirm the direction before editing. Done means both platforms give the same output for that input and the round trip keeps the leading space.
索引モデルが issue の本文から書いたものです。
説明
Description
The same HTML gives different text on Android and iOS. Android drops a space at the start of a paragraph and collapses consecutive spaces. iOS keeps both.
This has two effects:
- A paragraph that starts with a space loses that space on a plain
getHTML→setValueround trip on Android. Android itself serializes it as<p> a</p>. - HTML written by iOS loses spaces when it is loaded on Android. iOS serializes two spaces as two raw spaces, Android reads them as one.
Steps to reproduce
- Open the example app and go to the test screen.
- Tap Set Value and submit
<html><p> a b </p><p> c</p></html>. - Tap Show HTML.
| Output | |
|---|---|
| iOS | <p> a b </p><p> c</p> |
| Android | <p>a b </p><p>c</p> |
Round trip on Android only: type a (space, then a), read the HTML (<p> a</p>), set it back. The result is <p>a</p>.
Where it comes from
EnrichedParser.characters() ignores a space that follows another space or a newline. The Android serializer writes for consecutive spaces, so its own output survives for that case, but it writes a raw space at the start of a paragraph. The iOS serializer writes raw spaces in both cases.
Question
Which direction do you prefer?
- Android keeps whitespace as written when it parses the library's own
<html>…</html>format, or - both serializers write
wherever a raw space would be collapsed.
I can open a PR for either one.
Environment
- Library:
mainat 23cc179d - iOS 26.2 simulator (iPhone 17 Pro), Android API 30 emulator
- 主要言語
- C
- スター
- 1.4k
- フォーク
- 80
- 平均マージ
- 4日 19時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
software-mansion/react-native-enriched-html のほかの issue
-
[Web] Leading, trailing, and consecutive spaces in <p> and <codeblock> are stripped by setContent on mount / setValue対応中かも @pcbeingused333 が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
software-mansion/react-native-enriched-html#886 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
software-mansion/react-native-enriched-html#885 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
software-mansion/react-native-enriched-html#881 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
software-mansion/react-native-enriched-html#880 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
software-mansion/react-native-enriched-html#878 ·
メンテナーはふだん 2 日以内に返信
software-mansion/react-native-enriched-html の issue をすべて見る
似ている issue
-
[Android Auto] MU1017 (MHI2Q_JP_AUG22_P1017) cluster map works with a pinned profile — values insideオープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
kamgurgul/mib2q-carplay#74 ·
-
Claude:NotNeeded GPT:NotABug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open5gs/open5gs#5195 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
FriendsofECCE/ECCE#1358 ·
-
documentation needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
X11Libre/xserver#4255 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
antoxa2584x/nfsu2-sw#52 ·