wordpress-mobile / AztecEditor-iOS

A reusable native iOS visual HTML text editor component.
Mozilla Public License 2.0
611 stars 146 forks source link

Fix crash when underlining text with special glyphs #1384

Closed itsmeichigo closed 5 months ago

itsmeichigo commented 5 months ago

Fixes https://github.com/woocommerce/woocommerce-ios/issues/11866

Description

We have a custom implementation for underlining text, and the logic involves checking for a range of glyphs in strings. For text with special glyphs (e.g. Arabic language), this range is sometimes out of the bound of the text (I have yet to find an exact explanation for this).

The fix is to fall back to using the default implementation if we detect that a glyph range is invalid.

Testing steps