]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up implementation of N0 per UAX#9
authorEli Zaretskii <eliz@gnu.org>
Tue, 15 Mar 2022 19:21:20 +0000 (21:21 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 15 Mar 2022 19:21:20 +0000 (21:21 +0200)
* src/bidi.c (bidi_resolve_brackets): Instead of requiring
prev_for_neutral's type to be known, fall back on SOS, per
the UBA.

src/bidi.c

index 44b7422bdc6a840bd4131c73f9a77cde00eea3ef..4d2c74b17cd7db4bfc2f8c655d06a1b65cd6f80e 100644 (file)
@@ -2927,8 +2927,11 @@ bidi_resolve_brackets (struct bidi_it *bidi_it)
       else if (bidi_it->bracket_enclosed_type == STRONG_L   /* N0c, N0d */
               || bidi_it->bracket_enclosed_type == STRONG_R)
        {
-         eassert (bidi_it->prev_for_neutral.type != UNKNOWN_BT);
-         switch (bidi_it->prev_for_neutral.type)
+         bidi_type_t prev_type_for_neutral = bidi_it->prev_for_neutral.type;
+
+         if (prev_type_for_neutral == UNKNOWN_BT)
+           prev_type_for_neutral = embedding_type;
+         switch (prev_type_for_neutral)
            {
            case STRONG_R:
            case WEAK_EN: