-
I'm having a bit of an issue using templ. I've created components for common elements, and am having a great time. Loving templ, in general. What I'm not getting, is I have a component that basically wraps a string in It get's HTML escaped, which is expected of course, but I'm obviously missing something here. If I was storing the text in a database (the eventual endpoint here), how would I have embeded a link so it doesn't get escaped while passing it to the component? For reference, the very simple component for the paragraph:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
In most cases with templ, you don't want to be passing other HTML elements as strings. You can leverage what we call block components...
|
Beta Was this translation helpful? Give feedback.
You need to use
templ.Raw
.Of course be very careful that you know that the html you are rendering is safe!