Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The fixed failure modes lack regression coverage in the existing iOS Maestro suite.
1 open finding
What changed in this PR
Improves iOS HTML preprocessing resilience and fallback behavior.
Changes:
- Supports short HTML strings.
- Safely handles reversed body tags.
- Catches preprocessing failures and preserves raw input.
| File | Description |
|---|---|
ios/inputHtmlParser/InputHtmlParser.mm |
Adds exception handling. |
ios/htmlParser/HtmlParser.mm |
Fixes length and body-range parsing. |
ios/EnrichedTextInputView.mm |
Guards failed preprocessing. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
szydlovsky
reviewed
Oct 14, 2026
hejsztynx
marked this pull request as draft
October 15, 2026 10:36
hejsztynx
force-pushed
the
@ksienkiewicz/fix-ios-initial-html-processing-flow
branch
2 times, most recently
from
October 22, 2026 10:23
5287dc6 to
e1dbbf2
Compare
hejsztynx
force-pushed
the
@ksienkiewicz/fix-ios-initial-html-processing-flow
branch
from
October 22, 2026 10:24
e1dbbf2 to
97a8e3c
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved crash and content-corruption risks, together with inconsistent iOS fragment parsing, block approval.
5 open issues
Skip HTML normalization when clipboard input is nil · New Avoid raw body substring matching in Android HTML extraction · New Parse unwrapped fragments when HTML normalization is disabled · New Escape decoded attribute values in Gumbo serialization · New Use HTML-aware body boundaries to avoid matching comments · New
1 resolved since last review
Review effort: Balanced
| // Run through the Gumbo-based normalizer to convert arbitrary HTML | ||
| // into our canonical tag subset. | ||
| NSString *toNormalize = fixedHtml != nullptr ? fixedHtml : html; | ||
| NSString *normalized = [self normalizeExternalHtml:toNormalize]; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Closes #811
This PR addresses a couple of iOS issues:
<p>a</p></body>123<body>, where the closing and openingbodytags are swapped, the whole app crashedEnrichedTextparser, but not in the input oneAside from that, it introduces a modification into our normalizer flow. Now it's consistent across all three platforms and works as follows:
<html></html>tags, we strip them and extract html from the<body>tag, if there is oneuseHtmlNormalizerflag, and we normalize the current html if neededPreviously the main issue was that even with
useHtmlNormalizerset totrue, we didn't normalize the html when it was wrapped with<html>tags - we want to always normalize it, as<html>tags are not a guarantee of any sort that the structure is ours.This PR also introduces one fix, caught by an android regression test. Empty
<codeblock></codeblock>was normalized into<codeblock><p></p></codeblock>, which is something that android's parser does not handle correctly, so normalizer was adjusted -<p></p>is not emitted when empty. The iOS behavior effectively has not changed in this manner.I've run all the e2e tests, they pass.
Test Plan
Try out the cases I listed above on iOS, with both
EnrichedTextInputandEnrichedTextcomponents. Run the e2e tests on android/ios, experiment with html parsing, test the html round-trip withuseHtmlNormalizerset totrueandfalse.Screenshots / Videos
iOS bugs that were present:
Screen.Recording.2026-10-14.at.17.02.45.mov
Screen.Recording.2026-10-14.at.17.03.58.mov
Compatibility
Checklist