diff options
Diffstat (limited to 'markdown/extensions/sane_lists.py')
-rw-r--r-- | markdown/extensions/sane_lists.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/markdown/extensions/sane_lists.py b/markdown/extensions/sane_lists.py index 213c8a6..828ae7a 100644 --- a/markdown/extensions/sane_lists.py +++ b/markdown/extensions/sane_lists.py @@ -24,15 +24,23 @@ import re class SaneOListProcessor(OListProcessor): - CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.))[ ]+(.*)') SIBLING_TAGS = ['ol'] + def __init__(self, parser): + super(SaneOListProcessor, self).__init__(parser) + self.CHILD_RE = re.compile(r'^[ ]{0,%d}((\d+\.))[ ]+(.*)' % + (self.tab_length - 1)) + class SaneUListProcessor(UListProcessor): - CHILD_RE = re.compile(r'^[ ]{0,3}(([*+-]))[ ]+(.*)') SIBLING_TAGS = ['ul'] + def __init__(self, parser): + super(SaneUListProcessor, self).__init__(parser) + self.CHILD_RE = re.compile(r'^[ ]{0,%d}(([*+-]))[ ]+(.*)' % + (self.tab_length - 1)) + class SaneListExtension(Extension): """ Add sane lists to Markdown. """ |