evas_object_textblock: Fix binary search fail.

D8610 Makes API Testcase fault.

"&lt" is never searching.

@fix

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8803
This commit is contained in:
Woochanlee 2019-05-02 14:34:04 +00:00 committed by Marcel Hollerbach
parent a69392e838
commit fdfb781e22
2 changed files with 10 additions and 1 deletions

View File

@ -1271,8 +1271,8 @@ static const Escape_Value escape_values_e_common_sorted[] = {
ESCAPE_VALUE("&amp;", "\x26"),
ESCAPE_VALUE("&apos;", "\x27"),
ESCAPE_VALUE("&gt;", "\x3e"),
ESCAPE_VALUE("&quot;", "\x22"),
ESCAPE_VALUE("&lt;", "\x3c"),
ESCAPE_VALUE("&quot;", "\x22"),
};
/**
@ -8185,6 +8185,8 @@ _markup_get_text_utf8_append(Eina_Strbuf *sbuf, const char *text)
eina_strbuf_append(sbuf, "&amp;");
else if (ch == '"')
eina_strbuf_append(sbuf, "&quot;");
else if (ch == '\'')
eina_strbuf_append(sbuf, "&apos;");
else if (ch == _PARAGRAPH_SEPARATOR)
eina_strbuf_append(sbuf, "<ps/>");
else if (ch == _REPLACEMENT_CHAR)

View File

@ -3241,6 +3241,13 @@ EFL_START_TEST(evas_textblock_text_getters)
fail_if(strcmp(tmp2, "aa"));
free(tmp2);
free(tmp);
tmp = evas_textblock_text_markup_to_utf8(NULL, "&lt;align=center&gt;hello&lt;/align&gt;&amp;gt;&quot;&apos;");
fail_if(strcmp(tmp, "<align=center>hello</align>&gt;\"\'"));
tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp);
fail_if(strcmp(tmp2, "&lt;align=center&gt;hello&lt;/align&gt;&amp;gt;&quot;&apos;"));
free(tmp2);
free(tmp);
}
/* complex markup set/get */