From 55cf46e88a80bf7fade054925db58df57c3ed456 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 13 Nov 2008 00:30:33 -0500 Subject: Fixed core parser to differentiate between indented secondary lines of a list item that are additional lines of the first p and child list items. --- markdown.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'markdown.py') diff --git a/markdown.py b/markdown.py index 01c6540..9c93fa4 100755 --- a/markdown.py +++ b/markdown.py @@ -319,6 +319,7 @@ class OListProcessor(BlockProcessor): TAG = 'ol' RE = re.compile(r'^[ ]{0,3}\d+\.[ ](.*)') CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.)|[*+-])[ ](.*)') + INDENT_RE = re.compile(r'^[ ]{4,7}((\d+\.)|[*+-])[ ].*') def test(self, parent, block): return bool(self.RE.match(block)) @@ -357,13 +358,13 @@ class OListProcessor(BlockProcessor): m = self.CHILD_RE.match(line) if m: items.append(m.group(3)) - elif line.startswith(' '*4): + elif self.INDENT_RE.match(line): if items[-1].startswith(' '*4): items[-1] = '%s\n%s' % (items[-1], line) else: items.append(line) else: - items[-1] = '\n'.join([items[-1], line]) + items[-1] = '%s\n%s' % (items[-1], line) return items -- cgit v1.2.3