diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2014-05-26 10:47:35 +0400 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2014-05-26 10:47:35 +0400 |
commit | 54527a062fd4fe861a59cc994535f01acbf8d643 (patch) | |
tree | 29245eb4c0387c8e9687edd70a73ecf1326d9305 | |
parent | 663546de4cb60a51b04704ef080387ca8eca62a2 (diff) | |
download | markdown-54527a062fd4fe861a59cc994535f01acbf8d643.tar.gz markdown-54527a062fd4fe861a59cc994535f01acbf8d643.tar.bz2 markdown-54527a062fd4fe861a59cc994535f01acbf8d643.zip |
Make it easier to override list of inline patterns for InlineProcessor
-rw-r--r-- | markdown/treeprocessors.py | 5 |
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 |