HTMLFormat Label HTML not showing < or >

if static text, yes
if dynamic no :slight_smile:

Show an example of your global recycleList

:question:

Post a simple test aia.

label.aia (2.5 KB)

More work required by you, you would need to specify which tags to change.....

yes, need exception)

Like so

image

if the text is different every time and there may be several indexes, it is better to encode it back for each TAG
blocks - 2022-07-01T115917.377

Ah good, you have moved from finding problems to finding solutions :+1:

3 Likes

It would be better to use a more general solution. In PHP you have nice functions that encode or decode html entities: this is replacing < by &lt; and so on. In appinventor the Web component has a decode function, but what you want to have is an encode function.
Here is one:

You could use it like this:


you will find that calling the procedure will give as result:
"<text1>abc<text2>def"
and on your screen you will see: <text1>abc<text2>def
Here you have a restricted set of characters to encode: &, < and >. You could easily add more, such as " or '
Have fun with it.

2 Likes

it not work if have tag in text <br>, <i> and etc
need also add decode for tag

You have to use &lt; and &gt;

It will work.

Do it without procedures and see.

See post # 12 :wink:

it not work, this users generic text, not static text

you cannot just use < or >.

Did not understand this part.

user send message: <hello> <b>hi</b>

Yes, this is a can-of-worms.
In HTML you are expected to escape < to &lt; and > to &gt;
The software that creates these <hello> messages, where hello is not a tag, should do this for you.
If this is outside your influence, then your solution is best, although you could get a very long list of HTML tags that you have to escape.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.