]> granicus.if.org Git - fribidi/commitdiff
Fix rule X8 when paragraph-separator is present
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 5 Jan 2013 01:56:08 +0000 (19:56 -0600)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 5 Jan 2013 01:56:08 +0000 (19:56 -0600)
As discovered by:
https://github.com/behdad/fribidi-vs-unicode

All passing now.

lib/fribidi-bidi.c

index 6e67d57d55333ee0df4b44d5d34d9bce0cd4e968..89d65465a88cdd0f3fd0c6d7d8ca45df0d5ab828 100644 (file)
@@ -463,6 +463,13 @@ fribidi_get_par_embedding_levels (
          move_node_before (pp, explicits_list);
          pp = &temp_link;
        }
+      else if (this_type == FRIBIDI_TYPE_BS)
+       {
+         /* X8. All explicit directional embeddings and overrides are
+            completely terminated at the end of each paragraph. Paragraph
+            separators are not included in the embedding. */
+         break;
+       }
       else
        {
          /* X6. For all types besides RLE, LRE, RLO, LRO, and PDF:
@@ -475,11 +482,6 @@ fribidi_get_par_embedding_levels (
          if (!FRIBIDI_IS_NEUTRAL (override))
            RL_TYPE (pp) = override;
        }
-      /* X8. All explicit directional embeddings and overrides are
-         completely terminated at the end of each paragraph. Paragraph
-         separators are not included in the embedding. */
-      /* This function is running on a single paragraph, so we can do
-         X8 after all the input is processed. */
     }
 
     /* Implementing X8. It has no effect on a single paragraph! */