aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-11-05 15:16:36 -0500
committerWaylan Limberg <waylan@gmail.com>2008-11-05 15:16:36 -0500
commit9c6bf2b66f6eabadc6e9944878ca8c1142ea8e0d (patch)
tree9ed4603521bd3f430b5b76c4088f365e63113262
parent8aac03d7286cd896518a58acbfefa09399462dc6 (diff)
downloadmarkdown-9c6bf2b66f6eabadc6e9944878ca8c1142ea8e0d.tar.gz
markdown-9c6bf2b66f6eabadc6e9944878ca8c1142ea8e0d.tar.bz2
markdown-9c6bf2b66f6eabadc6e9944878ca8c1142ea8e0d.zip
Fixed InlineProcessor to use the inlinePatterns on the Markdown instance directly rather than a copied list of values set at init.
-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.