Skip to main content
August 27, 2025
Question

Converting and formatting HTML in an interface

  • August 27, 2025
  • 10 replies
  • 0 views

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
    August 28, 2025

    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 ) } ) )

    June 6, 2026

    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
    June 6, 2026

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

    stefanhelzle0001
    August 28, 2025

    The styled text editor has a readonly option.

    johnm744
    May 27, 2026

    Hi Stefan 

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