Skip to main content
New Participant
Aug 27, 2025 7:59 PM UTC
Question

Converting and formatting HTML in an interface

I have a record that stores text with HTML formatting from a Styled Text Editor Field. In one of my interfaces I pull that text from the record and display it with a rich text display field.

Is there a way for me to put the text in such that it keeps the styling? I've been using stripHTML() on the text but that just removes everything which is not what I need.

    10 replies

    shubhama926776
    Brainy
    Aug 28, 2025 3:22 AM UTC

    You cannot use Rich Text Display Field to show HTML-formatted text with styling. The solution is to use a read-only Styled Text Editor component. This way preserve the HTML formatting from your Styled Text Editor Field.

    See below working example

    a!localVariables(
      local!htmlText:"Bold Text
    Italic Text
    Underlined
    • Bullet 1
    • Bullet 2
    ", a!sectionLayout( label: "HTML Text Display Comparison", contents: { a!textField( label: "Raw HTML (stored value)", value: local!htmlText, readOnly: true ), a!textField( label: "Using stripHtml() - loses all formatting", value: stripHtml(local!htmlText), readOnly: true ), a!styledTextEditorField( label: "Using Read-Only Styled Text Editor - preserves formatting", value: local!htmlText, readOnly: true, sizeLimit: 1000 ) } ) )

    शुभम्
    Known Participant
    Jun 6, 2026 5:42 AM UTC

    I used styled text editor, but it's not preserving the html formatting, however it's enabling the links. I used a plugin richtexteditor, this is preserving the format as it is but disabling the links when used in readonly format. I want both the formatting and the links. How to resolve this?

    stefanhelzle0001
    Brainy
    Jun 6, 2026 1:00 PM UTC

    What kind of formatting are you talking about. The styled text editor will render all the formatting it supports when editing.

    stefanhelzle0001
    Brainy
    Aug 28, 2025 5:30 AM UTC

    The styled text editor has a readonly option.

    johnm744
    Inspiring
    May 27, 2026 1:19 PM UTC

    Hi Stefan 

    But apparently stuledText is not supported on mobile (ipad), or at least that's what happened to me in a project.