Rich-Text-Edior: How can I show a text in "code" styling?

Hey guys,

I am loading the initial text of a richt text entry field via a variable → basically this variable injects a prepared text.

My question: How do I have to adjust this “raw” text, so that a section in this text is displayed as “code” in the richt text editor? As If i would have marked the text section and clicked on “code”.

I think of a start and end command or samething ? Like

//code My text that should be shown in a code block :slight_smile: ///code ←

My text that should be shown in a code block :)

What are the commands (start / stop) / what is the way to" “prestyle” the text I am injecting?

Thanks alot!

Best

Peer

Hi Peer :waving_hand:

We are using markdown to style our rich text editor, and to use a code snippet you need to write “pre” + “code” in brackets:

<pre><code>code text</code></pre>

This will only work as an “initial value” for your rich text INPUT

Our rich text ELEMENT doesn’t accept code blocks natively.

1 Like