I am trying to send HTML to a template in Mojolicious and am finding that the html is getting replaced with safe strings somewhere along the way.
$self->stash(portalHeaderHtml => "<html>");
Becomes
<html>
In the source
The template:
<%= $portalHeaderHtml %>
How do I tell it to display HTML and not replace tags?
Mojolicious::Guides::Rendering
suggests using ==
to disable escaping of characters.
An additional equal sign can be used to disable escaping of the characters <, >, &, ' and " in results from Perl expressions, which is the default to prevent XSS attacks against your application.
<%== '<p>test</p>' %>
Proceed with caution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With