aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2008-11-13 00:30:33 -0500
committerWaylan Limberg <waylan@gmail.com>2008-11-13 23:27:44 -0500
commit55cf46e88a80bf7fade054925db58df57c3ed456 (patch)
tree799e7dafc9a61fea23e5b0f257cf75390f9c01f6
parent750ea44b2a1f3a2201f2c8588292543be0db12ef (diff)
downloadmarkdown-55cf46e88a80bf7fade054925db58df57c3ed456.tar.gz
markdown-55cf46e88a80bf7fade054925db58df57c3ed456.tar.bz2
markdown-55cf46e88a80bf7fade054925db58df57c3ed456.zip
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.
-rwxr-xr-xmarkdown.py5
1 files changed, 3 insertions, 2 deletions
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