diff --git a/Lexer.php b/Lexer.php index 9bcc195..6ba2610 100644 --- a/Lexer.php +++ b/Lexer.php @@ -947,9 +947,9 @@ protected function scanNewLine() protected function scanText($escaped = false) { - foreach ($this->scanToken('text', "([^\n]*)?") as $token) { + foreach ($this->scanToken('text', "[ ]?([^\n]*)?") as $token) { - $value = trim($this->getMatch(1)); + $value = trim($this->getMatch(1), "\t"); $token['value'] = $value; $token['escaped'] = $escaped; diff --git a/Test/IssueTest.php b/Test/IssueTest.php index cf2ae15..58bf18e 100644 --- a/Test/IssueTest.php +++ b/Test/IssueTest.php @@ -142,5 +142,10 @@ public function testIssue88() $this->assertEquals('', $this->renderer->compile("some-tag\t\nsome-other-tag")); $this->assertEquals('', $this->renderer->compile("some-tag \nsome-other-tag")); $this->assertEquals('', $this->renderer->compile("some-tag \t \nsome-other-tag")); + + $this->assertEquals('Some text', $this->renderer->compile('i.fa.fa-fw.fa-gear Some text')); + $this->assertEquals(' Some text', $this->renderer->compile('i.fa.fa-fw.fa-gear Some text')); + $this->assertEquals('Some text', $this->renderer->compile("i.fa.fa-fw.fa-gear\n\t| Some text")); + $this->assertEquals(' Some text', $this->renderer->compile("i.fa.fa-fw.fa-gear\n\t| Some text")); } } \ No newline at end of file