From 594b85a81eb883e3bc25c3e1021e0ac86691a6d2 Mon Sep 17 00:00:00 2001 From: Michael Ochmann Date: Mon, 12 Dec 2022 12:04:03 +0100 Subject: [PATCH] fixed bug where ordered lists and tables were wrongly detected --- src/Parser.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Parser.php b/src/Parser.php index 6655ef7..280ca37 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -657,9 +657,11 @@ class Parser { $this->parseHeading(); break; case TokenType::NUMBER: - $list = $this->parseList(ListType::ORDERED); - $this->document->appendChild($list); - break; + if ($this->next()->type === TokenType::DOT) { + $list = $this->parseList(ListType::ORDERED); + $this->document->appendChild($list); + break; + } case TokenType::BACKTICK: $this->parseCodeBlock(); break; @@ -670,8 +672,10 @@ class Parser { $this->parseReference(); break; case TokenType::PIPE: - $this->parseTable(); - break; + if ($this->next()->type === TokenType::COLON || $this->next()->type === TokenType::MINUS) { + $this->parseTable(); + break; + } case TokenType::GT: $this->parseBlockQuote(); break;