aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown.py')
-rwxr-xr-xmarkdown.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/markdown.py b/markdown.py
index b534f27..b534151 100755
--- a/markdown.py
+++ b/markdown.py
@@ -1202,6 +1202,7 @@ class InlineProcessor(Treeprocessor):
self.__placeholder_length = 4 + len(self.__placeholder_prefix) \
+ len(self.__placeholder_suffix)
self.__placeholder_re = re.compile(INLINE_PLACEHOLDER % r'([0-9]{4})')
+ self.markdown = md
def __makePlaceholder(self, type):
""" Generate a placeholder """
@@ -1248,10 +1249,10 @@ class InlineProcessor(Treeprocessor):
"""
if not isinstance(data, AtomicString):
startIndex = 0
- while patternIndex < len(self.patterns):
+ while patternIndex < len(self.markdown.inlinePatterns):
data, matched, startIndex = self.__applyPattern(
- self.patterns[patternIndex],
- data, patternIndex, startIndex)
+ self.markdown.inlinePatterns.value_for_index(patternIndex),
+ data, patternIndex, startIndex)
if not matched:
patternIndex += 1
return data
@@ -1830,9 +1831,6 @@ class Markdown:
configs = extension_configs)
self.reset()
- # Sort and add patterns only after all extensions are loaded.
- self.treeprocessors['inline'].patterns = self.inlinePatterns.values()
-
def registerExtensions(self, extensions, configs):
"""
Register extensions with this instance of Markdown.