Html tags in labels?

is it possible to pass basic html tags to a Label text as in LabelLetters?

I think so - but only the ones in the LabelLetters Docs under the label parameter.

https://zimjs.com/docs.html?item=LabelLetters

b, u, i, font, a

how?
Label.text =<i>how?</i> shows the tags, it doesn't underline the word

put quotes around the whole thing

new LabelLetters("<i>how?</i>") 
// or 
myLabel.text = "<i>how?</i>"

i put quotes around the whole thing, but the editor removed the `` part ... same if i put '' or ""

1 Like

I see - you can use three back-ticks (top left on keyboard) to start some code and end the code with another three back-ticks.

So... is it working? It works for us. Make sure you are using a right version of ZIM.

adding as a property works too

thanks for the three back-ticks tip! (how do i insert an image?)
it works for LabelLetters but not for Label
new LabelLetters("<i>how?</i>") is OK, but
myLabel.text = "<i>how?</i>" isn't. it shows <i>how?</i> and not how?

It only works in LabelLetters - as each letter is a separate Label - so we can control things. For a Label, it is all one object, so we have to have everything the same font, etc.