refactor(ios): simplify accessibility text element creation#188
Merged
hryhoriiK97 merged 2 commits intomainfrom Mar 27, 2026
Merged
Conversation
|
@hryhoriiK97 Nice, that's a clean approach! Collapsing the line fragment enumeration into a single element for link-free paragraphs is exactly the right first step — and filtering whitespace-only segments is a good detail I missed. Glad to see the Android side is coming too. Happy to help test once it lands — we're exercising this pretty heavily in our chat support bot with mixed content (lists, code blocks, inline links). I'll close my #186 since #188 covers the core fix. Let me know if there's anything I can help with on the remaining pieces. |
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.
What/Why?
Simplifies how VoiceOver text elements are created in MarkdownAccessibilityElementBuilder.
Previously, each paragraph was split into separate accessibility elements per visual line using NSLayoutManager line fragment enumeration. This caused VoiceOver to announce text line-by-line instead of as coherent paragraphs.
Now paragraphs without inline links produce a single accessibility element. Paragraphs with links are still segmented into text and link parts, but whitespace-only segments are filtered out to avoid empty announcements.
Known issue: Blockquote background/border doesn't wrap correctly when the text contains inline links — the border breaks at link boundaries instead of spanning the full line. This is a cosmetic issue caused by NSAttributedString drawing separate background rects per attribute run, and will be addressed in a future PR.
Fixes: #181
Testing
PR Checklist