Page MenuHomePhabricator

evas_textblock: markup text: improve handling invalide escape characters
ClosedPublic

Authored by ali.alzyod on Aug 3 2019, 2:19 AM.

Details

Summary

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

Test Plan
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include<Eina.h>
#include<Efl.h>
#include <Elementary.h>

EAPI_MAIN int
elm_main(int argc, char **argv)
{
   Evas_Object *win,*textblock;

   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);

   win = elm_win_util_standard_add("Main", "App");
   elm_win_autodel_set(win, EINA_TRUE);

  char * style = "DEFAULT='font=BreezeColorEmoji font_size=30 style=shadow color=#F00 text_class=entry align=center shadow_color=#00F color=#000'";
  textblock = evas_object_textblock_add(win);
  efl_text_multiline_set(textblock,EINA_FALSE);
  evas_object_textblock_legacy_newline_set(textblock,EINA_FALSE);
  evas_object_textblock_text_markup_set(textblock,"<font=Sans color=#000 font_size=30>Me & My friend & someone else</font>");

   evas_object_size_hint_weight_set(textblock,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(textblock,EVAS_HINT_FILL,EVAS_HINT_FILL);
   evas_object_show(textblock);

   evas_object_move(textblock,0,0);
   evas_object_resize(textblock,640,800);
   evas_object_resize(win,640,800);
   
   evas_object_show(win);
   elm_run();

   return 0;
}
ELM_MAIN()

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ali.alzyod created this revision.Aug 3 2019, 2:19 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

ali.alzyod requested review of this revision.Aug 3 2019, 2:19 AM
ali.alzyod edited the summary of this revision. (Show Details)Aug 3 2019, 2:24 AM
ali.alzyod edited the test plan for this revision. (Show Details)
ali.alzyod edited the summary of this revision. (Show Details)
cedric accepted this revision.Aug 19 2019, 11:32 AM
This revision is now accepted and ready to land.Aug 19 2019, 11:32 AM
This revision was automatically updated to reflect the committed changes.