aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/blockprocessors.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2009-06-17 17:14:01 -0400
committerWaylan Limberg <waylan@gmail.com>2009-06-17 17:14:01 -0400
commitc38f1813a1c2d7c531517a74c456166af92356b4 (patch)
tree0a9af9189447fe3cc38c88a2e3a3de8f807aa19f /markdown/blockprocessors.py
parent0ae9951f49eb75c8a9fb9f841673b889763c1811 (diff)
downloadmarkdown-c38f1813a1c2d7c531517a74c456166af92356b4.tar.gz
markdown-c38f1813a1c2d7c531517a74c456166af92356b4.tar.bz2
markdown-c38f1813a1c2d7c531517a74c456166af92356b4.zip
Fixed ticket 35. Lists now work when padded with five or more spaces after asterisk. Adjusted regex to eat all (one or more) of the spaces. While it may seem wrong (at least in the loose list case), this is how all other implementations work. And it solves a number of edge cases otherwise not accounted for in the list parser.
Diffstat (limited to 'markdown/blockprocessors.py')
-rw-r--r--markdown/blockprocessors.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/markdown/blockprocessors.py b/markdown/blockprocessors.py
index 79f4db9..7d3b137 100644
--- a/markdown/blockprocessors.py
+++ b/markdown/blockprocessors.py
@@ -256,11 +256,11 @@ class OListProcessor(BlockProcessor):
TAG = 'ol'
# Detect an item (``1. item``). ``group(1)`` contains contents of item.
- RE = re.compile(r'^[ ]{0,3}\d+\.[ ](.*)')
+ RE = re.compile(r'^[ ]{0,3}\d+\.[ ]+(.*)')
# Detect items on secondary lines. they can be of either list type.
- CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.)|[*+-])[ ](.*)')
+ CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.)|[*+-])[ ]+(.*)')
# Detect indented (nested) items of either type
- INDENT_RE = re.compile(r'^[ ]{4,7}((\d+\.)|[*+-])[ ].*')
+ INDENT_RE = re.compile(r'^[ ]{4,7}((\d+\.)|[*+-])[ ]+.*')
def test(self, parent, block):
return bool(self.RE.match(block))
@@ -324,7 +324,7 @@ class UListProcessor(OListProcessor):
""" Process unordered list blocks. """
TAG = 'ul'
- RE = re.compile(r'^[ ]{0,3}[*+-][ ](.*)')
+ RE = re.compile(r'^[ ]{0,3}[*+-][ ]+(.*)')
class HashHeaderProcessor(BlockProcessor):