|
|
@ -348,6 +348,18 @@ class Parser { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
array_push($elms, $obj); |
|
|
|
array_push($elms, $obj); |
|
|
|
|
|
|
|
} elseif ($this->current()->type === TokenType::SPACE) { // do linebreak when two spaces are at the EOL |
|
|
|
|
|
|
|
if ($this->last()->type === TokenType::SPACE && $this->next()->type === TokenType::EOL) { |
|
|
|
|
|
|
|
$this->consume(); |
|
|
|
|
|
|
|
$clearBuffer(); |
|
|
|
|
|
|
|
$elm = $this->document->createElement("br"); |
|
|
|
|
|
|
|
array_push($elms, $elm); |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$this->consume(); |
|
|
|
|
|
|
|
$buffer .= " "; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else |
|
|
|
} else |
|
|
|
$buffer .= self::StripBackslashes($this->consume()->data); |
|
|
|
$buffer .= self::StripBackslashes($this->consume()->data); |
|
|
|
} |
|
|
|
} |
|
|
@ -657,9 +669,11 @@ class Parser { |
|
|
|
$this->parseHeading(); |
|
|
|
$this->parseHeading(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case TokenType::NUMBER: |
|
|
|
case TokenType::NUMBER: |
|
|
|
|
|
|
|
if ($this->next()->type === TokenType::DOT) { |
|
|
|
$list = $this->parseList(ListType::ORDERED); |
|
|
|
$list = $this->parseList(ListType::ORDERED); |
|
|
|
$this->document->appendChild($list); |
|
|
|
$this->document->appendChild($list); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
case TokenType::BACKTICK: |
|
|
|
case TokenType::BACKTICK: |
|
|
|
$this->parseCodeBlock(); |
|
|
|
$this->parseCodeBlock(); |
|
|
|
break; |
|
|
|
break; |
|
|
|