aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-08-22 18:05:43 -0400
committerWaylan Limberg <waylan@gmail.com>2008-08-22 18:05:43 -0400
commit7aab75d64c94b525427bc792088da1e3e16936cc (patch)
treed859ee334535b1ce6dc5afbb8dcc861c3da81c0e
parent4a570659a462593261fd4037946ad681d12b804a (diff)
downloadmarkdown-7aab75d64c94b525427bc792088da1e3e16936cc.tar.gz
markdown-7aab75d64c94b525427bc792088da1e3e16936cc.tar.bz2
markdown-7aab75d64c94b525427bc792088da1e3e16936cc.zip
Added special case for raw html in safe-mode. The escaped/replaced html is now wrapped in <p> tags so we have valid html.
-rwxr-xr-xmarkdown.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/markdown.py b/markdown.py
index fca4225..6bdeccb 100755
--- a/markdown.py
+++ b/markdown.py
@@ -911,8 +911,9 @@ class RawHtmlTextPostprocessor(TextPostprocessor):
else:
html = HTML_REMOVED_TEXT
- text = text.replace("<p>%s</p>" % (HTML_PLACEHOLDER % i),
- html + "\n")
+ if not self.safeMode:
+ text = text.replace("<p>%s</p>" % (HTML_PLACEHOLDER % i),
+ html + "\n")
text = text.replace(HTML_PLACEHOLDER % i, html)
return text