summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_textblock.c
diff options
context:
space:
mode:
authorali <ali198724@gmail.com>2019-08-03 09:19:20 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-08-19 11:33:25 -0700
commite08ca174888da9d11742e2b08501a1449ebe5b7d (patch)
tree074b068c7d1e2e7285187f44830bb10d77725545 /src/lib/evas/canvas/evas_object_textblock.c
parenta821eb456a8c89943f306286669093e2a43aa1f1 (diff)
evas_textblock: markup text: improve handling invalide escape characters
Improve handling invalid escape characters. (*) When '&' character founded in Markup text. Old Behavior : Any text after '&' (if it is not escape), all text will be discarded New Behavior : Any text after '&' (if it is not escape), will be processes as normal plain text. Example: Markup Text : Hello X & Y & Z 1 2 3 Old output : Hello New output : Hello X & Y & Z 1 2 3 This is related to T8077 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9489
Diffstat (limited to 'src/lib/evas/canvas/evas_object_textblock.c')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 6299e3f..433597f 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -8144,6 +8144,12 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
8144 _prepend_escaped_char(cur, esc_start, esc_end + 1); 8144 _prepend_escaped_char(cur, esc_start, esc_end + 1);
8145 esc_start = esc_end = NULL; 8145 esc_start = esc_end = NULL;
8146 } 8146 }
8147 else if (*p == 0 && esc_start) /* escape start with no end, append it as text */
8148 {
8149 _prepend_text_run(cur, esc_start, p);
8150 esc_start = esc_end = NULL;
8151 s = NULL;
8152 }
8147 else if (*p == 0) 8153 else if (*p == 0)
8148 { 8154 {
8149 _prepend_text_run(cur, s, p); 8155 _prepend_text_run(cur, s, p);
@@ -8154,6 +8160,12 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
8154 } 8160 }
8155 if (*p == '<') 8161 if (*p == '<')
8156 { 8162 {
8163 if (esc_start) /* escape start with no end, append it as text */
8164 {
8165 _prepend_text_run(cur, esc_start, p);
8166 esc_start = esc_end = NULL;
8167 s = NULL;
8168 }
8157 if (!esc_start) 8169 if (!esc_start)
8158 { 8170 {
8159 /* Append the text prior to this to the textblock and mark 8171 /* Append the text prior to this to the textblock and mark
@@ -8174,6 +8186,12 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
8174 } 8186 }
8175 else if (*p == '&') 8187 else if (*p == '&')
8176 { 8188 {
8189 if (esc_start) /* escape start with no end, append it as text */
8190 {
8191 _prepend_text_run(cur, esc_start, p);
8192 esc_start = esc_end = NULL;
8193 s = NULL;
8194 }
8177 if (!tag_start) 8195 if (!tag_start)
8178 { 8196 {
8179 /* Append the text prior to this to the textblock and mark 8197 /* Append the text prior to this to the textblock and mark