Don't bail when ZWJ cleanup found end-of-text marker#807
Conversation
Cleanup needs to continue and remove the rest of the ZWJs if any.
|
Are there any details about the reason to remove the ZWJ character within the text? ZWJ is used to "combine" other characters and display those as single char. If we remove it we're messing up the original text, no? |
Yeah, so, the Constants.ZWJ is used as a "temporary" character during the parsing process to make empty block elements have some content. See SPAN_EXCLUSIVE_EXCLUSIVE at that point and that span flag doesn't allow the span to be 0-length.
Regarding disrupting multi-sequence emojis, I guess we got lucky here. In fact, we got ourselves a wrong naming of the constant... we have it as ZWJ (Zero Width Joiner), but the accurate name is ZWS (Zero Width Space) and it's a different code point. The typical ZWJ is |
|
What do you think about changing the name of the |
We should do it :nod: (in a separate PR so this one gets merged faster) |
Addresses wordpress-mobile/gutenberg-mobile#845
This PR fixes an Aztec issue where the ZWJ cleanup function was bailing too early if the end-of-text marker was found. Instead, cleanup needs to continue and remove the rest of the ZWJs if any.
Gutenberg-mobile PR: wordpress-mobile/gutenberg-mobile#868
To test
Use the gutenberg-mobile PR and follow the steps there, thanks!