Preformatted text in UXML

Is there a way to do preformatted text in UXML? ( in HTML there’s the pre tag, but it looks like this is missing from UXML).

Hello!

The team recently added support for WhiteSpace.Pre and WhiteSpace.PreWrap to offer more flexibility on how whitespaces are handled.

Take a look at the white-space USS property here, which follows the same syntax as the CSS property. Unity - Manual: USS properties reference

Also, take a look at the rich text tags: Unity - Manual: Supported rich text tags

That’s good to know about the whitespace, I was wondering more about preventing tags from being processed. (As a simple way of preventing the user from inputting tags to change the uxml when taking text from a text input field and displaying on a lable or something).

I just looked at the supported tags page, I think the < noparse > tag is what I am looking for. Thanks for the help.

1 Like