Permalink
Browse files

Merge branch 'master' into extra

  • Loading branch information...
2 parents a228680 + 79677f6 commit 572596bfb08681f518d664ef3e4405ffadb8a7a9 @michelf committed Mar 11, 2008
Showing with 4 additions and 1 deletion.
  1. +4 −1 markdown.php
View
5 markdown.php
@@ -1006,7 +1006,7 @@ function processListItems($list_str, $marker_any) {
$list_str = preg_replace_callback('{
(\n)? # leading line = $1
(^[ ]*) # leading whitespace = $2
- ('.$marker_any.') [ ]+ # list marker = $3
+ ('.$marker_any.' [ ]+) # list marker and space = $3
((?s:.+?)) # list item text = $4
(?:(\n+(?=\n))|\n) # tailing blank line = $5
(?= \n* (\z | \2 ('.$marker_any.') [ ]+))
@@ -1020,11 +1020,14 @@ function _processListItems_callback($matches) {
$item = $matches[4];
$leading_line =& $matches[1];
$leading_space =& $matches[2];
+ $marker_space = $matches[3];
$tailing_blank_line =& $matches[5];
if ($leading_line || $tailing_blank_line ||
preg_match('/\n{2,}/', $item))
{
+ # Replace marker with the appropriate whitespace indentation
+ $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item;
$item = $this->runBlockGamut($this->outdent($item)."\n");
}
else {

0 comments on commit 572596b

Please sign in to comment.