title: disabling autoescape in flask
body: <p>I want to show some text to the user. the string variable I'm sending has multiple newline characters and I dont want <code>\n</code> to be displayed. so I did:</p>
  
  <pre><code>footext = """f
  o
  o"""
  
  #footext == "f\no\no"
  
  @app.route("/someurl")
  def foo():
      return render_template("bar.html", text = footext.replace("\n", "&lt;br /&gt;"))
  </code></pre>
  
  <p>bar.html : </p>
  
  <pre><code>&lt;html&gt;
  {{ text }}
  &lt;/html&gt;
  </code></pre>
  
  <p>However autoescape is enabled and what I see is <code>f&lt;br /&gt;o&lt;br /&gt;o</code>. Also my method isn't safe, I want every tag except <code>&lt;br /&gt;</code> to be escaped from the text. I took a look at flask.Markup module and however they don't really work either. </p>
  
  <p>What is the proper way to do this?</p>