python - Include link in html output -


i using following code print error messages

{% if error %}     <div class="alert alert-dismissable alert-danger login-fail">         <button type="button" class="close" data-dismiss="alert">&times;</button>         {{ error }}     </div> {% endif %} 

where error provided template flask code

... return render_template('register.html', error="this test error message.") 

i include hyperlink in error message. if do

    return render_template('register.html', error="this test error message <a href="http//example.com" </a>.") 

it prints string. how can make sure html recognizes html code? carl

normally flask escapes html tags. if want disable replace {{ error }} {{ error | safe}}. prevents autoescaping.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -