aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/inlinepatterns.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-01-19 06:30:23 -0500
committerWaylan Limberg <waylan@gmail.com>2012-01-19 06:30:23 -0500
commit0735b01dd9ab63417b1e9ee204d6090257cb8dbe (patch)
treec7f97608ac9baceb944befcc27990e903b4bb93d /markdown/inlinepatterns.py
parente3c5efd182d9a80f34e3b9a770eed63c1d62b2f9 (diff)
downloadmarkdown-0735b01dd9ab63417b1e9ee204d6090257cb8dbe.tar.gz
markdown-0735b01dd9ab63417b1e9ee204d6090257cb8dbe.tar.bz2
markdown-0735b01dd9ab63417b1e9ee204d6090257cb8dbe.zip
Inline html is now escaped by the searializer.
Final fix to issue introduced in fix for #59. Weird stuff inside angle brackets now also work in safe_mode='escape'. We just did the same thing as with block html, let the (x)html searializer do the escaping. Tests updated including the standalone test moved to match the non-escape cases.
Diffstat (limited to 'markdown/inlinepatterns.py')
-rw-r--r--markdown/inlinepatterns.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py
index 3f92737..5e923e9 100644
--- a/markdown/inlinepatterns.py
+++ b/markdown/inlinepatterns.py
@@ -71,7 +71,8 @@ def build_inlinepatterns(md_instance, **kwargs):
inlinePatterns["automail"] = AutomailPattern(AUTOMAIL_RE, md_instance)
inlinePatterns["linebreak2"] = SubstituteTagPattern(LINE_BREAK_2_RE, 'br')
inlinePatterns["linebreak"] = SubstituteTagPattern(LINE_BREAK_RE, 'br')
- inlinePatterns["html"] = HtmlPattern(HTML_RE, md_instance)
+ if md_instance.safeMode != 'escape':
+ inlinePatterns["html"] = HtmlPattern(HTML_RE, md_instance)
inlinePatterns["entity"] = HtmlPattern(ENTITY_RE, md_instance)
inlinePatterns["not_strong"] = SimpleTextPattern(NOT_STRONG_RE)
inlinePatterns["strong_em"] = DoubleTagPattern(STRONG_EM_RE, 'strong,em')