aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/treeprocessors.py
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2014-05-26 10:47:35 +0400
committerDmitry Shachnev <mitya57@gmail.com>2014-05-26 10:47:35 +0400
commit54527a062fd4fe861a59cc994535f01acbf8d643 (patch)
tree29245eb4c0387c8e9687edd70a73ecf1326d9305 /markdown/treeprocessors.py
parent663546de4cb60a51b04704ef080387ca8eca62a2 (diff)
downloadmarkdown-54527a062fd4fe861a59cc994535f01acbf8d643.tar.gz
markdown-54527a062fd4fe861a59cc994535f01acbf8d643.tar.bz2
markdown-54527a062fd4fe861a59cc994535f01acbf8d643.zip
Make it easier to override list of inline patterns for InlineProcessor
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r--markdown/treeprocessors.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py
index ef0a2aa..32b73b1 100644
--- a/markdown/treeprocessors.py
+++ b/markdown/treeprocessors.py
@@ -53,6 +53,7 @@ class InlineProcessor(Treeprocessor):
+ len(self.__placeholder_suffix)
self.__placeholder_re = util.INLINE_PLACEHOLDER_RE
self.markdown = md
+ self.inlinePatterns = md.inlinePatterns
def __makePlaceholder(self, type):
""" Generate a placeholder """
@@ -99,9 +100,9 @@ class InlineProcessor(Treeprocessor):
"""
if not isinstance(data, util.AtomicString):
startIndex = 0
- while patternIndex < len(self.markdown.inlinePatterns):
+ while patternIndex < len(self.inlinePatterns):
data, matched, startIndex = self.__applyPattern(
- self.markdown.inlinePatterns.value_for_index(patternIndex),
+ self.inlinePatterns.value_for_index(patternIndex),
data, patternIndex, startIndex)
if not matched:
patternIndex += 1