Commit 11e05050 authored by Skia's avatar Skia

Fix tests and force Markdown renderer to escape HTML

parent daee59f7
Pipeline #762 passed with stage
in 3 minutes and 11 seconds
......@@ -121,7 +121,7 @@ class SithInlineLexer(InlineLexer):
except: pass
return super(SithInlineLexer, self)._process_link(m, link, title)
renderer = SithRenderer()
renderer = SithRenderer(escape=True)
inline = SithInlineLexer(renderer)
markdown = Markdown(renderer, inline=inline)
......
......@@ -253,8 +253,8 @@ http://git.an
response = self.client.get(reverse('core:page', kwargs={'page_name': 'guy'}))
self.assertTrue(response.status_code == 200)
self.assertTrue('<p>Guy <em>bibou</em></p>\\n<p><a href="http://git.an">http://git.an</a></p>\\n' +
'<h1>Swag</h1>\\n<p>&lt;guy&gt;Bibou&lt;/guy&gt;</p>\\n' +
'<p>&lt;script&gt;alert(&#39;Guy&#39;);&lt;/script&gt;</p>' in str(response.content))
'<h1>Swag</h1>\\n&lt;guy&gt;Bibou&lt;/guy&gt;' +
"&lt;script&gt;alert(\\'Guy\\');&lt;/script&gt;" in str(response.content))
#TODO: many tests on the pages:
# - renaming a page
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment