Preserve grapheme clusters in upper corner completion suggester highlighting
Grapheme clusters in Indic scripts can be split by highlighting,
resulting in really ugly text in the suggestions. For example,
म + े should equal मे, but doesn't if highlighting markup comes between
the two characters. Affected scripts include Devanagari, Tamil, Telegu,
Thai, Myanmar, Khmer, and Javanese, and probably others. Latin and
Cyrillic script also have the problem, but the presentation is not as
bad (at least on some browser/OS combinations).
- Define a comboMarks regex (equivalent to \p{Mark} in other programming
languages) and use it in a new highlighting function,
prefixPlusComboHighlight, to include trailing combining characters in
highlighted text.
- Change the calling function to use prefixPlusComboHighlight instead of
prefixHighlight.
Note: This only fixes problems with **grapheme clusters** in
suggestions in the **search box in the upper corner** (upper right in
LTR languages, upper left in RTL languages). The main search box on the
Special:Search page uses different code. Ligatures, such as
Arabic ي + ا becoming يا, are not covered by this simple regex-based
solution.
Bug: T35242
Change-Id: I915c50180bc2196e0302f27835241624b7837f16