Connect-flash message with HTML?
I would like to include the link in the connect-flash message text:
Js
req.flash("registerMessage", "Sorry, the User ID you chose is already in use. Please choose another. If you have already registered and need assistance logging in, <a href=\"http://www.example.com/support/\">contact support</a>");
EJS
<% if (message.length > 0) { %>
<div class="alert alert-danger"><%= message %></div>
<% } %>
Result
<div class="alert alert-danger">Sorry, the User ID you chose is already in use. Please choose another. If you have already registered and need assistance logging in, <a href="http://www.example.com/support/">contact support</a>.</div>
Is there a way to prevent Flash from appearing from HTML characters so that I can display links in my posts?
+3
source to share