From 481e50700e269f9a56337cd9fabc3b5251958d10 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 18 Jan 2012 23:56:56 -0500 Subject: Fixed #59. Raw HTML parsing is no longer slow. Replaced the unescape method I carlessly threw in the RawHtmlProcessor. Unfortunetly, this reintroduces the bug just fixed in commit 425fde141f17973aea0a3a85e44632fe18737996 Sigh! --- markdown/postprocessors.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'markdown/postprocessors.py') diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py index 962728b..672953a 100644 --- a/markdown/postprocessors.py +++ b/markdown/postprocessors.py @@ -60,21 +60,10 @@ class RawHtmlPostprocessor(Postprocessor): text = text.replace("

%s

" % (self.markdown.htmlStash.get_placeholder(i)), html + "\n") - html = self.unescape(html) text = text.replace(self.markdown.htmlStash.get_placeholder(i), html) return text - def unescape(self, html): - """ Unescape any markdown escaped text within inline html. """ - for k, v in self.markdown.treeprocessors['inline'].stashed_nodes.items(): - ph = util.INLINE_PLACEHOLDER % k - try: - html = html.replace(ph, '%s' % util.etree.tostring(v)) - except: - html = html.replace(ph, '\%s' % v) - return html - def escape(self, html): """ Basic html escaping """ html = html.replace('&', '&') @@ -82,7 +71,6 @@ class RawHtmlPostprocessor(Postprocessor): html = html.replace('>', '>') return html.replace('"', '"') - def isblocklevel(self, html): m = re.match(r'^\<\/?([^ ]+)', html) if m: -- cgit v1.2.3