aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/postprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2015-03-14 20:39:46 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2018-01-11 19:04:49 -0500
commit7f63b20b819b83afef0ddadc2e210ddce32a2be3 (patch)
treec92e6bbd942e65588466c5800a32545fc1d57948 /markdown/postprocessors.py
parent6366e5ae8f0ae19c033a2c24c217001c1512292b (diff)
downloadmarkdown-7f63b20b819b83afef0ddadc2e210ddce32a2be3.tar.gz
markdown-7f63b20b819b83afef0ddadc2e210ddce32a2be3.tar.bz2
markdown-7f63b20b819b83afef0ddadc2e210ddce32a2be3.zip
Removed deprecated safe_mode.
Diffstat (limited to 'markdown/postprocessors.py')
-rw-r--r--markdown/postprocessors.py21
1 files changed, 3 insertions, 18 deletions
diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py
index 7b9aa0b..f59e070 100644
--- a/markdown/postprocessors.py
+++ b/markdown/postprocessors.py
@@ -50,19 +50,11 @@ class RawHtmlPostprocessor(Postprocessor):
""" Restore raw html to the document. """
def run(self, text):
- """ Iterate over html stash and restore "safe" html. """
+ """ Iterate over html stash and restore html. """
replacements = OrderedDict()
for i in range(self.markdown.htmlStash.html_counter):
- html, safe = self.markdown.htmlStash.rawHtmlBlocks[i]
- if self.markdown.safeMode and not safe:
- if str(self.markdown.safeMode).lower() == 'escape':
- html = self.escape(html)
- elif str(self.markdown.safeMode).lower() == 'remove':
- html = ''
- else:
- html = self.markdown.html_replacement_text
- if (self.isblocklevel(html) and
- (safe or not self.markdown.safeMode)):
+ html = self.markdown.htmlStash.rawHtmlBlocks[i]
+ if self.isblocklevel(html):
replacements["<p>%s</p>" %
(self.markdown.htmlStash.get_placeholder(i))] = \
html + "\n"
@@ -74,13 +66,6 @@ class RawHtmlPostprocessor(Postprocessor):
return text
- def escape(self, html):
- """ Basic html escaping """
- html = html.replace('&', '&amp;')
- html = html.replace('<', '&lt;')
- html = html.replace('>', '&gt;')
- return html.replace('"', '&quot;')
-
def isblocklevel(self, html):
m = re.match(r'^\<\/?([^ >]+)', html)
if m: