aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2009-06-17 17:16:05 -0400
committerWaylan Limberg <waylan@gmail.com>2009-06-17 17:20:21 -0400
commit6d30c9ff6b43be9f013e6ea129ff7611c4a6d55b (patch)
tree3d9c83c8d9a05153113bb8ae8a9f186b462aeff6
parent8498081907a1172f7e6bec016b8130ac4e80c2d6 (diff)
parentc38f1813a1c2d7c531517a74c456166af92356b4 (diff)
downloadmarkdown-6d30c9ff6b43be9f013e6ea129ff7611c4a6d55b.tar.gz
markdown-6d30c9ff6b43be9f013e6ea129ff7611c4a6d55b.tar.bz2
markdown-6d30c9ff6b43be9f013e6ea129ff7611c4a6d55b.zip
Merge branch 'master' into tests
-rw-r--r--markdown/blockprocessors.py8
-rw-r--r--markdown/tests/misc/lists6.html18
-rw-r--r--markdown/tests/misc/lists6.txt14
3 files changed, 36 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):
diff --git a/markdown/tests/misc/lists6.html b/markdown/tests/misc/lists6.html
new file mode 100644
index 0000000..24aad38
--- /dev/null
+++ b/markdown/tests/misc/lists6.html
@@ -0,0 +1,18 @@
+<p>Test five or more spaces as start of list:</p>
+<ul>
+<li>five spaces</li>
+</ul>
+<p>not first item:</p>
+<ul>
+<li>one space</li>
+<li>five spaces</li>
+</ul>
+<p>loose list:</p>
+<ul>
+<li>
+<p>one space</p>
+</li>
+<li>
+<p>five spaces</p>
+</li>
+</ul> \ No newline at end of file
diff --git a/markdown/tests/misc/lists6.txt b/markdown/tests/misc/lists6.txt
new file mode 100644
index 0000000..f12788f
--- /dev/null
+++ b/markdown/tests/misc/lists6.txt
@@ -0,0 +1,14 @@
+Test five or more spaces as start of list:
+
+* five spaces
+
+not first item:
+
+* one space
+* five spaces
+
+loose list:
+
+* one space
+
+* five spaces