<raw> Not working properly on labels in 2022R1?

Same exact code works in 2021R3.1

Message = "<raw>"
Message = Message + "Nombre de la Clínica: " + " <strong>" + ClinicName + "</strong> <br>"
Message = Message + "Enviado en Fecha: " + SentDate + " "
Message = Message + "</raw>"
label1.text = Message

If I remove the strong tag the code works properly.
Under 2022R1 it is not displayed properly. Something got changed that I’m not aware of?

Yes, WebLabels now are using Display Flex and is changing how your code works.
You can remove Flex and make it work like 2021r3.1 with this:

label1.Style.Value("display") = ""

Edit: not tested in all situations, it seems to work for your example.

Thanks Alberto. That did the trick

Hector, another option (and to not remove the Display Flex) is to change your code to:

Message = "<raw><span>"
Message = Message + "Nombre de la Clínica: " + " <strong>" + ClinicName + "</strong> <br>"
Message = Message + "Enviado en Fecha: " + SentDate + " "
Message = Message + "</span></raw>"

Maybe this is better for you. Hope this helps.


That’s unfortunate. Please file a bug report so they can fix that.

Good idea! Thank you @AlbertoD

Please consider also using a WebHTMLViewer if you plan to render HTML. You won’t need to rely on <raw> there.

Message = "Nombre de la Clínica: " + " <strong>" + ClinicName + "</strong> <br>"
Message = Message + "Enviado en Fecha: " + SentDate

That’s overkill if all you want is a label. <raw> was added specifically to allow users to insert html in all kinds of situations… including values inside other controls which you can’t use an HTMLViewer for. Please don’t break this functionality.

1 Like

Sure Greg, I’d appreciate a Feedback case, as you said. I hate to break things and I’m sorry for causing this issue.

Still, <raw> is not documented, it is completely unexpected and it could change (or not) in the future. I wouldn’t rely on it, when there is a specific control for rendering unescaped HTML.

Whoa wait a sec. This feature was specifically added (more than 5 years ago by me in fact) to allow adding unescaped html into any control. The fact that it’s not documented is Xojo’s issue, and more than a few users rely on its behavior.

FWIW, the fact that it appears in release notes means that it is documented though.

See 2017r1 case #45204 and 35156

That functionality was specifically brought forward to Web 2 at user request.


Please keep <raw>. I personally don’t use it much but is good that it is there and I know I can use it if I need it for a project.

I have seen some posts that others do use it. It has some advantages.

1 Like

Please don’t make a big ball from this.

There is a specific issue with how WebLabel plays with <raw>, but <raw> hasn’t changed globally, and doesn’t necessary have to. @AlbertoD already provided a workaround.

I’ll prepare a Feedback case to improve the documentation on this topic, as isn’t obvious. While it’s handy, it also has implications that needs to be considered by the user.

Another user of <raw> here. Please retain the functionality.

If you need a starting place <raw> is documented here: WebToolbarContainer.Caption - Xojo Documentation

There is no need to vote to retain this functionality, as isn’t planned to be removed. If in the (not near) future needs to be changed, an alternative will surely be provided (we all need to throw some raw HTML from time to time)

The WebLabel bug needs to be fixed (please shout me if you find this is affecting something else), and the documentation needs to make it clear that <raw> exists.

At the moment, there is no organic or easy way to find info about <raw>, unless you already know it exists and actively search for this tag.


Hey Ricardo!

I have no plans to make a big ball out of this, just wanted to know how to handle what was changed and I was not aware of. I know this will be fixed or documented ASAP.
Keep up the good work :slight_smile:

1 Like

The label I’m setting the Text to is used for a simple confirmation, the HTMLViewer would be overkill for such a thing. That’s why I think is awesome for such things.

1 Like

I’ve created this case, so anybody interested can subscribe:

Thank you.