In 27 md safeMode Out 27 True In 28 print python def normalize_html da

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
In [27]: md.safeMode
Out[27]: True
In [28]: print a
:::python
def normalize_html(data):
from BeautifulSoup import BeautifulSoup
soup = BeautifulSoup(data) "<h1>123</h1>"
return unicode(soup)
In [29]: print md.convert(a)
<div class="codehilite"><pre><span class="k">def</span> <span class="nf">normalize_html</span><span class="p">(</span><span class="n">data</span><span class="p">):</span>
<span class="k">from</span> <span class="nn">BeautifulSoup</span> <span class="k">import</span> <span class="n">BeautifulSoup</span>
<span class="n">soup</span> <span class="o">=</span> <span class="n">BeautifulSoup</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="s">&quot;&lt;h1&gt;123&lt;/h1&gt;&quot;</span>
<span class="k">return</span> <span class="nb">unicode</span><span class="p">(</span><span class="n">soup</span><span class="p">)</span>
</pre></div>