Showing formatted text in a textblock

Is there a possibility to show formatted snippets of json or sql in a textblock on a node?

in my case i have a code snippet in Jinja templating language, which i want to show on the node.

{% macro dollar_to_cent(column_name) %}
    ({{ column_name }} * 100)
{% endmacro %}

Can’t you evaluate it and show the resulting string?

sure, i can do that. but the goal is to show the snippet itself.

Oh, I see – you want to display text including “{% macro dollar_to_cent(column_name) %}” but with “dollar_to_cent” in blue. Odd, the forum doesn’t let me color any text…

OK, use what’s demonstrated in Rich Text Rendering. Basically you need to mark-up the string into simple HTML.