Skip to content

Commit

Permalink
Make it easier to override list of inline patterns for InlineProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed May 26, 2014
1 parent 663546d commit 54527a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions markdown/treeprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(self, md):
+ 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 """
Expand Down Expand Up @@ -99,9 +100,9 @@ def __handleInline(self, data, patternIndex=0):
"""
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
Expand Down

0 comments on commit 54527a0

Please sign in to comment.