[libdazzle] fuzzy: ignore ' when highlighting



commit 07c89b2ae5764b21dfd8f674dcfe2b490f61cae5
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jun 3 19:21:26 2017 -0700

    fuzzy: ignore &apos; when highlighting
    
    This is a fairly common one, so we can skip it along with &amp;

 src/fuzzy/dzl-fuzzy-mutable-index.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/fuzzy/dzl-fuzzy-mutable-index.c b/src/fuzzy/dzl-fuzzy-mutable-index.c
index e3157fd..ac1eaf7 100644
--- a/src/fuzzy/dzl-fuzzy-mutable-index.c
+++ b/src/fuzzy/dzl-fuzzy-mutable-index.c
@@ -590,11 +590,20 @@ dzl_fuzzy_highlight (const gchar *str,
       str_ch = g_utf8_get_char (str);
       match_ch = g_utf8_get_char (match);
 
-      if (str_ch == '&' && !strncmp (str, "&amp;", 5))
+      if (str_ch == '&')
         {
-          str += 4;
-          g_string_append (ret, "&amp;");
-          continue;
+          if (0 == strncmp (str, "&amp;", 5))
+            {
+              str += 4;
+              g_string_append (ret, "&amp;");
+              continue;
+            }
+          else if (0 == strncmp (str, "&apos;", 6))
+            {
+              str += 5;
+              g_string_append (ret, "&apos;");
+              continue;
+            }
         }
 
       if ((str_ch == match_ch) ||


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]