protected function parseListLine($line)
{
$depth = 0;
for ($i = 0; $i < strlen($line); $i++) {
$char = $line[$i];
if ($char == ' ') {
$depth++;
} else {
if ($char == "\t") {
$depth += 2;
} else {
break;
}
}
}
if (preg_match('/^((\\*|\\-)|([\\d#]+)\\.) (.+)$/', trim($line), $match)) {
return array('prefix' => $line[$i], 'ordered' => $line[$i] == '*' || $line[$i] == '-' ? false : true, 'depth' => $depth, 'text' => array($match[4]));
}
return false;
}