be less aggressive inserting LTR following bidi #850

This commit is contained in:
nick black 2020-10-05 18:48:52 -04:00 committed by Nick Black
parent 4466f1aaff
commit 23bd4a2ac8

View File

@ -910,7 +910,8 @@ egc_rtl(const char* egc, int* bytes){
if(r == (size_t)-1 || r == (size_t)-2){ if(r == (size_t)-1 || r == (size_t)-2){
return NULL; return NULL;
} }
if(!uc_bidi_category(w)){ // FIXME too aggressive, counts punctuation etc const int bidic = uc_bidi_category(w);
if(bidic != UC_BIDI_R && bidic != UC_BIDI_RLE && bidic != UC_BIDI_RLO){
return NULL; return NULL;
} }
// insert U+200E, "LEFT-TO-RIGHT MARK". This ought reset the text direction // insert U+200E, "LEFT-TO-RIGHT MARK". This ought reset the text direction