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;
    }
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;
    }
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 ; }
Parses a list line

@param string $line the string line
@return array containing:
- true if the list is ordered, false else
- the depth of the list
- the text of the first line without the tick
Parses a list line