[iOS] Named entity rendered literally, then saved as  
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- html, objective-c, react-native
調査の方向性
Start with ios/extensions/StringExtension.mm and inspect getEscapedCharactersInfoFrom and its unescapeMap; the issue identifies this as the iOS decoding path. Compare its named-reference handling with the existing numeric-reference handling and the suggested entities. Done when the reproduction renders a non-breaking space on iOS and getHTML() or onChangeHtml no longer turns into  ; check whether the existing iOS tests cover this path.
索引モデルが issue の本文から書いたものです。
説明
Before submitting a new issue
- I tested using the latest version of the library, as the bug might be already fixed. (1.1.1, the latest release; the code below is unchanged on
main@ 0d015a7b1d) - I tested using a supported version of react native.
- I checked for possible duplicate issues, with possible answers. (Related but different: #235 / #258 fixed
&<>, and #636 / #638 fixed numeric references.)
Bug summary
On iOS, EnrichedTextInput (and EnrichedText) render the named character reference as the literal six characters . The next getHTML() / onChangeHtml then escapes the &, so the stored HTML becomes &nbsp;. After that, the literal text shows up on every platform, because it is now real text.
is very common input. The HTML serialization algorithm (WHATWG "escaping a string") writes U+00A0 as . So HTML produced on the web (innerHTML, this library's web editor, Tiptap/ProseMirror getHTML()) contains it whenever the text has a non-breaking space. Browsers insert one for a trailing or double space typed in a contenteditable. This library's Android serializer (EnrichedParser.withinStyle) also writes runs of spaces as . So content written on web or Android and then edited on iOS gets corrupted.
Cause: getEscapedCharactersInfoFrom in ios/extensions/StringExtension.mm only maps &, < and >, plus numeric references. Android (TagSoup) and web (DOMParser) decode named references.
Suggested fix: add at least → U+00A0, " → " and ' → ' to unescapeMap. Ideally, decode the full HTML5 named-reference table.
Workaround we use for now: before passing HTML to the component, rewrite / " / ' to   / " / ', which iOS already decodes.
Library version
1.1.1
Environment info
react-native 0.86.2
expo 57.0.14 (dev client, new architecture)
react 19.2.3
iOS Simulator 18.6 (iPhone 16 Pro); also seen on a physical iPhone running iOS 26
Steps to reproduce
- On iOS, render an
EnrichedTextInputwith:<EnrichedTextInput defaultValue={'<html><p>Hello world</p></html>'} onChangeHtml={(e) => console.log(e.nativeEvent.value)} /> - Observed: the input shows
Hello world. Expected:Hello world, with a non-breaking space. - Type one character. Observed in
onChangeHtml:…Hello&nbsp;world…. Expected: U+00A0 (or ), not&nbsp;. - The same HTML on Android and web renders correctly.
Reproducible example repository
No standalone repo yet. The steps above use the stock component only, with no app code involved.
- 主要言語
- C
- スター
- 1.4k
- フォーク
- 73
- 平均マージ
- 2日 10時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
software-mansion/react-native-enriched-html のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
software-mansion/react-native-enriched-html#833 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
HTML normalizer adds empty list items for whitespace around blocks inside <li>対応中かも @RaphaelFakhri が 3 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
software-mansion/react-native-enriched-html#829 ·
メンテナーはふだん 3 日以内に返信
-
iOS dynamic frameworks fail to link UniformTypeIdentifiers対応中かも @hejsztynx が 1 日前に担当しました。 オープンbug
難易度 2/5 1時間未満 初心者へのやさしさ 73/100
software-mansion/react-native-enriched-html#826 ·
メンテナーはふだん 3 日以内に返信
-
Android: typing with Bold, Italic, Underline or Strikethrough active crashes R8 release builds (NoSuchMethodException on span constructor)対応中かも @Junveloper が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
software-mansion/react-native-enriched-html#839 ·
メンテナーはふだん 3 日以内に返信
-
[Feature request] Vertical spacing (margins) for headings and lists in htmlStyle対応中かも @henrikra が 1 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
software-mansion/react-native-enriched-html#832 ·
メンテナーはふだん 3 日以内に返信
software-mansion/react-native-enriched-html の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
containers/crun#2415 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zephyrproject-rtos/zephyr#123423 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
dspromote: /etc/exports uses -alldirs on non-mount-point directories, so mountd exports nothingオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
nextbsd/nextbsd-userland#434 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信