From 54527a062fd4fe861a59cc994535f01acbf8d643 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Mon, 26 May 2014 10:47:35 +0400 Subject: Make it easier to override list of inline patterns for InlineProcessor --- markdown/treeprocessors.py | 5 +++-- 1 file 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 -- cgit v1.2.3