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