diff --git a/.gitignore b/.gitignore index 81b9258..e17c7ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ composer.lock phpunit.xml vendor +.phpunit.result.cache diff --git a/src/EmojiParser.php b/src/EmojiParser.php index 2f9d50b..fc8de6b 100755 --- a/src/EmojiParser.php +++ b/src/EmojiParser.php @@ -75,11 +75,6 @@ public function parse(InlineParserContext $inlineContext): bool { $cursor = $inlineContext->getCursor(); - $previous = $cursor->peek(-1); - if ($previous !== null && $previous !== ' ') { - return false; - } - $saved = $cursor->saveState(); $cursor->advance(); @@ -92,14 +87,6 @@ public function parse(InlineParserContext $inlineContext): bool return false; } - $next = $cursor->peek(0); - - if ($next !== null && $next !== ' ') { - $cursor->restoreState($saved); - - return false; - } - $key = substr($handle, 0, -1); if ($this->map === null) { diff --git a/tests/EmojiParserTest.php b/tests/EmojiParserTest.php index 7b06d2f..4a0aaf4 100755 --- a/tests/EmojiParserTest.php +++ b/tests/EmojiParserTest.php @@ -30,9 +30,10 @@ public function provideRenderCases() [':+1:', '
foo bar baz: lol
'], - [':+1:123', ':+1:123
'], + [':+1:123', '123
:123123123:
'], [':+1 :', ':+1 :
'], + [':+1::+1:', '