Is it possible to use html tags in textfields for html5 export?


I’m working on a flash game port to html5, and i’m wondering if i can use html tags in textfields like in as3.
I tried using the htmlText property of a Textfield, i did some research and it seems to work only on flash export.

Is there any way i can use html tags or i have to use the “setTextFormat” function to set some parts of a textfield in bold/italic/colors ?
Or maybe there is another solution ?

Thanks for reading :slight_smile:

Yes it’s possible, and it has been merged last year.

If there is a regression bug, please open an issue on github.

Ok great ! thanks for the link, i tried again and it worked !

But i found what caused the tag to not work, if the closing tag isn’t surrounded by at least one white space, it doesn’t work.

for example, this works:

txtfld.htmlText = 'testing colors: <font color="#0B3B17">这是一个中文文本 </font>你好中文';

whereas this doesn’t : :frowning:

txtfld.htmlText = 'testing colors: <font color="#0B3B17">这是一个中文文本</font>你好中文';

I also had an issue where word wrap doesn’t work on chinese characters if there is no space between them, but there is already an issue opened on github about that.