[iOS] Named entity rendered literally, then saved as  
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- html, objective-c, react-native
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 69
- Merge medio
- 9g 3h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di software-mansion/react-native-enriched-html
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 73/100
software-mansion/react-native-enriched-html#826 ·
I maintainer di solito rispondono entro 5 giorni
-
[iOS] Checkbox checked state lost/misplaced after an inline imageForse già presa @henrikra l’ha presa 4 giorni fa. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
software-mansion/react-native-enriched-html#819 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
[iOS] Tags not parsed on iOS below a certain string lengthForse già presa @hejsztynx l’ha presa 7 giorni fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
software-mansion/react-native-enriched-html#811 · 3 commenti ·
I maintainer di solito rispondono entro 5 giorni
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
software-mansion/react-native-enriched-html#810 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
software-mansion/react-native-enriched-html#803 ·
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di software-mansion/react-native-enriched-html
Issue simili
-
v9.6.0: CMake incorrectly enforces presence of libevdevForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Unhandled ValueError terminates watchdog thread when GISRC value contains multiple colonsApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug Component component: net
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RT-Thread/rt-thread#11913 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
contiki-ng/contiki-ng#3289 ·
I maintainer di solito rispondono entro 3 giorni
-
area:docs help wanted type:enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno