Inserting HTML into mysql Database showing Type Error : <p>I am developing a Webapp using Flask. At some point, I have to insert a certain HTML script into a MySQL database:</p>

<pre><code>&lt;h3&gt;Welcome!&lt;/h3&gt;
&lt;p&gt;Some text&lt;/p&gt;
</code></pre>

<p>When I insert it into the database (when it is returned by flask's 'render_template' function):</p>

<pre><code>\n\n&lt;h3&gt;Welcome!&lt;/h3&gt;\n\n\n\n&lt;p&gt;Some text&lt;/p&gt;
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p><code>TypeError: ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\\\\\\\\n\\\\n&lt;h3&gt;Welcome!&lt;/h3&gt;\\\\n\\\\n\\\\n\\\\n&lt;p&gt;Some text' at line 1") is not JSON serializable</code></p>
</blockquote>

<p>I first don't understand what 'JSON serializable' means, and I want to know what I am doing wrong. I have already tried taking off the linebreaks (<code>\n</code>) but it still shows the same error. Why? I am thankful for any answer you can provide.</p>
