fixed bug where ordered lists and tables were wrongly detected

feature/strict-mode
Michael Ochmann 3 years ago
parent f3bbcb07e7
commit 594b85a81e
  1. 14
      src/Parser.php

@ -657,9 +657,11 @@ class Parser {
$this->parseHeading(); $this->parseHeading();
break; break;
case TokenType::NUMBER: case TokenType::NUMBER:
$list = $this->parseList(ListType::ORDERED); if ($this->next()->type === TokenType::DOT) {
$this->document->appendChild($list); $list = $this->parseList(ListType::ORDERED);
break; $this->document->appendChild($list);
break;
}
case TokenType::BACKTICK: case TokenType::BACKTICK:
$this->parseCodeBlock(); $this->parseCodeBlock();
break; break;
@ -670,8 +672,10 @@ class Parser {
$this->parseReference(); $this->parseReference();
break; break;
case TokenType::PIPE: case TokenType::PIPE:
$this->parseTable(); if ($this->next()->type === TokenType::COLON || $this->next()->type === TokenType::MINUS) {
break; $this->parseTable();
break;
}
case TokenType::GT: case TokenType::GT:
$this->parseBlockQuote(); $this->parseBlockQuote();
break; break;

Loading…
Cancel
Save