aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/extensions
diff options
context:
space:
mode:
authorKar Epker <karepker+services@gmail.com>2015-06-01 01:03:51 -0400
committerKar Epker <karepker+services@gmail.com>2015-06-01 01:03:51 -0400
commit6cbc66b4e63de0ddba7413b653591274fc6587cf (patch)
tree2340c8226ce8c9eefd2cf301cab271928d94b811 /markdown/extensions
parente594213ab689847ee7d9654817b8fa80fafb0fb7 (diff)
downloadmarkdown-6cbc66b4e63de0ddba7413b653591274fc6587cf.tar.gz
markdown-6cbc66b4e63de0ddba7413b653591274fc6587cf.tar.bz2
markdown-6cbc66b4e63de0ddba7413b653591274fc6587cf.zip
Fixed parser ignoring value of tab_length.
Diffstat (limited to 'markdown/extensions')
-rw-r--r--markdown/extensions/sane_lists.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/markdown/extensions/sane_lists.py b/markdown/extensions/sane_lists.py
index 213c8a6..e1f2fc3 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):
+ OListProcessor.__init__(self, parser)
+ self.CHILD_RE = re.compile(''.join([
+ r'^[ ]{0,', str(self.tab_length - 1), r'}((\d+\.))[ ]+(.*)']))
+
class SaneUListProcessor(UListProcessor):
- CHILD_RE = re.compile(r'^[ ]{0,3}(([*+-]))[ ]+(.*)')
SIBLING_TAGS = ['ul']
+ def __init__(self, parser):
+ UListProcessor.__init__(self, parser)
+ self.CHILD_RE = re.compile(''.join([
+ r'^[ ]{0,', str(self.tab_length - 1), r'}(([*+-]))[ ]+(.*)']))
+
class SaneListExtension(Extension):
""" Add sane lists to Markdown. """