You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a need to render entire templ components, while bypassing all the built-in HTML escaping.
Something like component.RenderRaw(context.Background(), os.Stdout)?
I am aware of the function @templ.Raw() that can be used inside of templ components, but I'd like to do this for an entire component.
Before anyone objects to this for security reasons, I need to do this because I am not actually rendering HTML. I'm trying to use templ as a more advanced alternative to Go's "text/template" package, as my needs have grown more complex than "text/template" can reasonably support.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have a need to render entire templ components, while bypassing all the built-in HTML escaping.
Something like
component.RenderRaw(context.Background(), os.Stdout)
?I am aware of the function
@templ.Raw()
that can be used inside of templ components, but I'd like to do this for an entire component.Before anyone objects to this for security reasons, I need to do this because I am not actually rendering HTML. I'm trying to use templ as a more advanced alternative to Go's
"text/template"
package, as my needs have grown more complex than"text/template"
can reasonably support.Thanks in advance for any assistance.
Beta Was this translation helpful? Give feedback.
All reactions