docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RichTextUtils

    Helpers to safely embed untrusted text inside UI Toolkit rich text.

    Inheritance
    object
    RichTextUtils
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Core
    Assembly: Unity.AppUI.dll
    Syntax
    public static class RichTextUtils

    Methods

    Escape(string)

    Wraps untrusted text in a <noparse> region so that any formatting tag it contains is displayed literally instead of being interpreted.

    Declaration
    public static string Escape(string text)
    Parameters
    Type Name Description
    string text

    The untrusted text.

    Returns
    Type Description
    string

    Rich text that renders text verbatim.

    NeutralizeNoParse(string)

    Neutralizes any </noparse> marker in text so it cannot terminate an enclosing noparse region.

    Declaration
    public static string NeutralizeNoParse(string text)
    Parameters
    Type Name Description
    string text

    The untrusted text.

    Returns
    Type Description
    string

    The text with every closing noparse marker broken.

    Remarks

    UI Toolkit noparse regions do not nest and end at the first closing marker the parser sees, so an embedded marker would re-enable tag interpretation for the rest of the text.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)