aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/preprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2010-01-03 23:27:49 -0500
committerWaylan Limberg <waylan@gmail.com>2010-01-03 23:27:49 -0500
commit3587cb2d6ea31723757251c0be86d12625dec7c3 (patch)
tree2ebf029f623762f8a1c74e12d55d1aa428a5d619 /markdown/preprocessors.py
parentc2d50b46b536a440b6d73c6bf309bdaf03b90abb (diff)
downloadmarkdown-3587cb2d6ea31723757251c0be86d12625dec7c3.tar.gz
markdown-3587cb2d6ea31723757251c0be86d12625dec7c3.tar.bz2
markdown-3587cb2d6ea31723757251c0be86d12625dec7c3.zip
Added processing of markdown text within raw html to the 'extra' extension. Fixes Ticket 39. NOTE: I did not add a seperate extension which only adds this feature - it is only available as part of 'extra'.
Diffstat (limited to 'markdown/preprocessors.py')
-rw-r--r--markdown/preprocessors.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py
index cbf40e3..b199f0a 100644
--- a/markdown/preprocessors.py
+++ b/markdown/preprocessors.py
@@ -227,7 +227,8 @@ class HtmlBlockPreprocessor(Preprocessor):
# if find closing tag
in_tag = False
if self.markdown_in_raw and 'markdown' in attrs.keys():
- start = items[0][:left_index]
+ start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?',
+ '', items[0][:left_index])
items[0] = items[0][left_index:]
end = items[-1][-len(right_tag)-2:]
items[-1] = items[-1][:-len(right_tag)-2]
@@ -243,7 +244,8 @@ class HtmlBlockPreprocessor(Preprocessor):
if items:
if self.markdown_in_raw and 'markdown' in attrs.keys():
- start = items[0][:left_index]
+ start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?',
+ '', items[0][:left_index])
items[0] = items[0][left_index:]
end = items[-1][-len(right_tag)-2:]
items[-1] = items[-1][:-len(right_tag)-2]