From 944e4846847abc9b252f9b016158e336ffb77443 Mon Sep 17 00:00:00 2001
From: fluffy http://example.org/ and sms:+1234567890 http://example.org/ and sms:+1234567890This is a code-fence. <hello>\n
This is a code-fence. <hello>\n
"),
+ (" This is a four-character indent. This is a four-character indent. <hello>\n
")]
+
+ for (input, expected) in examples:
+ self.assertEqual(convert(input), expected)
diff --git a/isso/utils/html.py b/isso/utils/html.py
index 1bbd8e6..a694562 100644
--- a/isso/utils/html.py
+++ b/isso/utils/html.py
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
+import html
import bleach
import misaka
@@ -74,8 +75,8 @@ class Unofficial(misaka.HtmlRenderer):
"""
def blockcode(self, text, lang):
- lang = ' class="{0}"'.format(lang) if lang else ''
- return "{0}
\n".format(text, lang)
+ lang = ' class="{0}"'.format(html.escape(lang)) if lang else ''
+ return "{0}
\n".format(html.escape(text,False), lang)
class Markup(object):