aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/postprocessors.py
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2010-07-05 14:22:22 -0400
committerToshio Kuratomi <toshio@fedoraproject.org>2010-07-05 14:22:22 -0400
commitb50560edc707241b236f9d6c3f33edcf09d7cf33 (patch)
treecbb7d24f0784d05730bd3c637bb9e163c933c047 /markdown/postprocessors.py
parentcf1e33c216b1ea5ce18f660025744d9f8b66fb7c (diff)
downloadmarkdown-b50560edc707241b236f9d6c3f33edcf09d7cf33.tar.gz
markdown-b50560edc707241b236f9d6c3f33edcf09d7cf33.tar.bz2
markdown-b50560edc707241b236f9d6c3f33edcf09d7cf33.zip
Break cyclic import of markdown. This allows people to embed markdown
if they desire.
Diffstat (limited to 'markdown/postprocessors.py')
-rw-r--r--markdown/postprocessors.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py
index e5c2e06..ceb897f 100644
--- a/markdown/postprocessors.py
+++ b/markdown/postprocessors.py
@@ -9,7 +9,8 @@ processing.
"""
-import markdown
+import misc
+import preprocessors
class Processor:
def __init__(self, markdown_instance=None):
@@ -51,19 +52,19 @@ class RawHtmlPostprocessor(Postprocessor):
elif str(self.markdown.safeMode).lower() == 'remove':
html = ''
else:
- html = markdown.HTML_REMOVED_TEXT
+ html = misc.HTML_REMOVED_TEXT
if safe or not self.markdown.safeMode:
text = text.replace("<p>%s</p>" %
- (markdown.preprocessors.HTML_PLACEHOLDER % i),
+ (preprocessors.HTML_PLACEHOLDER % i),
html + "\n")
- text = text.replace(markdown.preprocessors.HTML_PLACEHOLDER % i,
+ text = text.replace(preprocessors.HTML_PLACEHOLDER % i,
html)
return text
def unescape(self, html):
""" Unescape any markdown escaped text within inline html. """
for k, v in self.markdown.treeprocessors['inline'].stashed_nodes.items():
- ph = markdown.INLINE_PLACEHOLDER % k
+ ph = misc.INLINE_PLACEHOLDER % k
html = html.replace(ph, '\%s' % v)
return html
@@ -81,5 +82,5 @@ class AndSubstitutePostprocessor(Postprocessor):
pass
def run(self, text):
- text = text.replace(markdown.AMP_SUBSTITUTE, "&")
+ text = text.replace(misc.AMP_SUBSTITUTE, "&")
return text