Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:26:40+00:00 2026-06-14T17:26:40+00:00

I am using jinja2 to safely render templates for email messages from a web

  • 0

I am using jinja2 to safely render templates for email messages from a web contact form. The problem is the characters &, <, >, ‘, and ” are converted to HTML-safe sequences. So

That’s all folks!

becomes

That&#39;s all folks!

I want to remove any HTML tags to prevent XSS without any without any character encoding. Is that possible in jinja2?

Note: the striptags utility also converts characters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:26:42+00:00Added an answer on June 14, 2026 at 5:26 pm

    I don’t think that’s possible. How would you deal with a message such as That's only true when x<y and x>0. The parts between < and > are part of the message, but could be interpreted as an (borked) HTML tag.

    It’s up to the browser to read That&#39;s all folks! and display it correctly by decoding the characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Jinja2 templates with Bottle.py and Google App Engine's dev_appserver for development. I
I have managed to call python functions from jinja2 by using custom filters, but
The code below is a sample form I'm using to learn jinja2. As written,
Using WebViewBrush I can render web page content (it's screen shot) to e.g. Rectangle
I am using Jinja2 templates for my GAE Python application. Actually there are a
I am writing a web application on google app engine in python using jinja2
I started web development 2 weeks ago using GAE,WebApp2,Jinja2 and WTForms. I read though
I am building a web application on google app engine using python and jinja2.
I'm using Jinja2's nl2br filter, which looks like: import re from jinja2 import environmentfilter,
I'm using python google app engine with the webapp framework, substituting jinja2 templates for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.