Currently I have this code
boldtext = "<b>I'm bolded!<b>"
@app.route('/')
def index():
return render_template("index.html", boldtext=boldtext)
and then in my index.html, I have a section of code with {{ boldtext }} in it.
I had thought that once the page loaded I would see this:
I'm bolded!
Instead I see this:
<b>I'm bolded!<b>
Is there anyway for me to pass actual HTML code to the index.html rather than a snippet of just text?
You're looking for the safe filter.
{{ boldtext|safe }}
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