Commit 996bcdd332551b82791ab0851e2f7f826bc0a4ed

Fix bug with rawhtml and markdown escaping. Previously, any inline rawhtml that contained text that fit markdown's escaping syntax (i.e. <x\]>) was never unescaped. Now it is. Markdown probably shouldn't be escaping before removing rawhtml in the first place, but this will do for now.
  
4444 """ Iterate over html stash and restore "safe" html. """
4545 for i in range(self.markdown.htmlStash.html_counter):
4646 html, safe = self.markdown.htmlStash.rawHtmlBlocks[i]
47 html = self.unescape(html)
4748 if self.markdown.safeMode and not safe:
4849 if str(self.markdown.safeMode).lower() == 'escape':
4950 html = self.escape(html)
5959 text = text.replace(markdown.preprocessors.HTML_PLACEHOLDER % i,
6060 html)
6161 return text
62
63 def unescape(self, html):
64 """ Unescape any markdown escaped text within inline html. """
65 for k, v in self.markdown.treeprocessors['inline'].stashed_nodes.items():
66 ph = markdown.INLINE_PLACEHOLDER % k
67 html = html.replace(ph, '\%s' % v)
68 return html
6269
6370 def escape(self, html):
6471 """ Basic html escaping """
  
1111
1212<p>And of course <script>blah</script>.</p>
1313<p><a href="script&gt;stuff&lt;/script">this <script>link</a></p>
14<p>Some funky <x\]> inline stuff with markdown escaping syntax.</p>
  
1414And of course <script>blah</script>.
1515
1616[this <script>link](<script>stuff</script>)
17
18Some funky <x\]> inline stuff with markdown escaping syntax.