How to show HTML Entities in a ~H - Sigil Enviroment

Hello everybody,

First of all Happy new Year all of you.
I fiddle a little bit around a site and have the problem, that I need to print out the content of a string with HTML Entities inside.

My Code in my View (inside a function get_text looks like this:

content  = HtmlEntities.decode(content)

    ~H"""
    <%= content_tag t, class: @class do %>
      <%= content %>
    <% end %>
    """

At the …html.heex - Page I can show this using my function like:

<.get_text .../>

It is working so far, but, the HTML-Tags inside my content string are displayed as HTML Code, not as parsed HTML. Despite the package HtmlEntities. If I look into the browser, I see that Elixir sends this content-String like this: “

Text … <a href …>” and so son, he uses quotes, so that the browser do not parse this as html-Tags.

I can not find no hint, how to get this content in a way the browser parses it as Html-Tags.

Any Ideas?

I wish all of you a nice weekend and say thanks!
Sven

Excuse me, I closed my notebook, stood up and wanted to go to bed. BUT! I remembered a function called raw().

So I tried

~H"""
    <%= content_tag t, class: @class do %>
      <%= raw(content) %>
    <% end %>
    """

and yeah! It worked, thank you so much!

Sven