aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/treeprocessors.py
diff options
context:
space:
mode:
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r--markdown/treeprocessors.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py
index df5e748..0177e43 100644
--- a/markdown/treeprocessors.py
+++ b/markdown/treeprocessors.py
@@ -1,15 +1,14 @@
from __future__ import unicode_literals
from __future__ import absolute_import
from . import util
-from . import odict
from . import inlinepatterns
def build_treeprocessors(md_instance, **kwargs):
""" Build the default treeprocessors for Markdown. """
- treeprocessors = odict.OrderedDict()
- treeprocessors["inline"] = InlineProcessor(md_instance)
- treeprocessors["prettify"] = PrettifyTreeprocessor(md_instance)
+ treeprocessors = util.Registry()
+ treeprocessors.register(InlineProcessor(md_instance), 'inline', 20)
+ treeprocessors.register(PrettifyTreeprocessor(md_instance), 'prettify', 10)
return treeprocessors
@@ -103,8 +102,8 @@ class InlineProcessor(Treeprocessor):
startIndex = 0
while patternIndex < len(self.inlinePatterns):
data, matched, startIndex = self.__applyPattern(
- self.inlinePatterns.value_for_index(patternIndex),
- data, patternIndex, startIndex)
+ self.inlinePatterns[patternIndex], data, patternIndex, startIndex
+ )
if not matched:
patternIndex += 1
return data