diff --git a/Parser.php b/Parser.php
index ac83201..dce3226 100644
--- a/Parser.php
+++ b/Parser.php
@@ -143,7 +143,7 @@ public function makeHtml($text): string
         $this->_id = 0;
 
         usort($this->blockParsers, function ($a, $b) {
-            return $a[1] < $b[1] ? - 1 : 1;
+            return $a[1] < $b[1] ? -1 : 1;
         });
 
         foreach ($this->blockParsers as $parser) {
@@ -197,7 +197,7 @@ public function hook(string $type, callable $callback)
     public function makeHolder(string $str): string
     {
         $key = "\r" . $this->_uniqid . $this->_id . "\r";
-        $this->_id ++;
+        $this->_id++;
         $this->_holders[$key] = $str;
 
         return $key;
@@ -234,7 +234,7 @@ private function makeFootnotes(string $html): string
                 }
 
                 $html .= "<li id=\"fn-{$index}\">{$val}</li>";
-                $index ++;
+                $index++;
             }
 
             $html .= '</ol></div>';
@@ -288,7 +288,7 @@ private function releaseHolder(string $text, bool $clearHolders = true): string
         $deep = 0;
         while (strpos($text, "\r") !== false && $deep < 10) {
             $text = str_replace(array_keys($this->_holders), array_values($this->_holders), $text);
-            $deep ++;
+            $deep++;
         }
 
         if ($clearHolders) {
@@ -304,7 +304,7 @@ private function releaseHolder(string $text, bool $clearHolders = true): string
      *
      * @return string
      */
-    private function markLine(int $start, int $end = - 1): string
+    private function markLine(int $start, int $end = -1): string
     {
         if ($this->_line) {
             $end = $end < 0 ? $start : $end;
@@ -323,10 +323,10 @@ private function markLine(int $start, int $end = - 1): string
      */
     private function markLines(array $lines, int $start): array
     {
-        $i = - 1;
+        $i = -1;
 
         return $this->_line ? array_map(function ($line) use ($start, &$i) {
-            $i ++;
+            $i++;
             return $this->markLine($start + $i) . $line;
         }, $lines) : $lines;
     }
@@ -389,9 +389,10 @@ private function call(string $type, ...$args)
     private function parseInline(
         string $text,
         string $whiteList = '',
-        bool $clearHolders = true,
-        bool $enableAutoLink = true
-    ): string {
+        bool   $clearHolders = true,
+        bool   $enableAutoLink = true
+    ): string
+    {
         $text = $this->call('beforeParseInline', $text);
 
         // code
@@ -666,7 +667,7 @@ private function parseBlock(string $text, ?array &$lines): array
         $lines = explode("\n", $text);
         $this->_blocks = [];
         $this->_current = 'normal';
-        $this->_pos = - 1;
+        $this->_pos = -1;
 
         $state = [
             'special' => implode("|", array_keys($this->_specialWhiteList)),
@@ -723,7 +724,7 @@ private function parseBlockList(?array $block, int $key, string $line, ?array &$
                 $this->setBlock($key);
                 return false;
             } elseif (preg_match("/^(\s*)$/", $line) && $state['empty'] == 0) {
-                $state['empty'] ++;
+                $state['empty']++;
                 $this->setBlock($key);
                 return false;
             }
@@ -1036,53 +1037,54 @@ private function parseBlockQuote(?array $block, int $key, string $line): bool
      */
     private function parseBlockTable(?array $block, int $key, string $line, ?array &$state, array $lines): bool
     {
-        if (preg_match("/^\s*(\|?[ :]*-+[ :]*(?:\|[ :]*-+[ :]*)*\|?)\s*$/", $line, $matches)) {
-            if ($this->isBlock('table')) {
-                $block[3][0][] = $block[3][2];
-                $block[3][2] ++;
-                $this->setBlock($key, $block[3]);
-            } else {
-                $head = 0;
-
-                if (empty($block) ||
-                    $block[0] != 'normal' ||
-                    preg_match("/^\s*$/", $lines[$block[2]])) {
-                    $this->startBlock('table', $key);
+        if (preg_match("/^\s*(\|?[ :]*-{2,}[ :]*(?:[\|\+][ :]*-{2,}[ :]*)*\|?)\s*$/", $line, $matches)) {
+            if (strpos($matches[1], '|') !== false || strpos($matches[1], '+') !== false) {
+                if ($this->isBlock('table')) {
+                    $block[3][0][] = $block[3][2];
+                    $block[3][2]++;
+                    $this->setBlock($key, $block[3]);
                 } else {
-                    $head = 1;
-                    $this->backBlock(1, 'table');
-                }
+                    $head = 0;
+
+                    if (empty($block) ||
+                        $block[0] != 'normal' ||
+                        preg_match("/^\s*$/", $lines[$block[2]])) {
+                        $this->startBlock('table', $key);
+                    } else {
+                        $head = 1;
+                        $this->backBlock(1, 'table');
+                    }
 
-                if ($matches[1][0] == '|') {
-                    $matches[1] = substr($matches[1], 1);
+                    if ($matches[1][0] == '|') {
+                        $matches[1] = substr($matches[1], 1);
 
-                    if ($matches[1][strlen($matches[1]) - 1] == '|') {
-                        $matches[1] = substr($matches[1], 0, - 1);
+                        if ($matches[1][strlen($matches[1]) - 1] == '|') {
+                            $matches[1] = substr($matches[1], 0, -1);
+                        }
                     }
-                }
 
-                $rows = preg_split("/(\+|\|)/", $matches[1]);
-                $aligns = [];
-                foreach ($rows as $row) {
-                    $align = 'none';
-
-                    if (preg_match("/^\s*(:?)\-+(:?)\s*$/", $row, $matches)) {
-                        if (!empty($matches[1]) && !empty($matches[2])) {
-                            $align = 'center';
-                        } elseif (!empty($matches[1])) {
-                            $align = 'left';
-                        } elseif (!empty($matches[2])) {
-                            $align = 'right';
+                    $rows = preg_split("/(\+|\|)/", $matches[1]);
+                    $aligns = [];
+                    foreach ($rows as $row) {
+                        $align = 'none';
+
+                        if (preg_match("/^\s*(:?)\-+(:?)\s*$/", $row, $matches)) {
+                            if (!empty($matches[1]) && !empty($matches[2])) {
+                                $align = 'center';
+                            } elseif (!empty($matches[1])) {
+                                $align = 'left';
+                            } elseif (!empty($matches[2])) {
+                                $align = 'right';
+                            }
                         }
+
+                        $aligns[] = $align;
                     }
 
-                    $aligns[] = $align;
+                    $this->setBlock($key, [[$head], $aligns, $head + 1]);
                 }
-
-                $this->setBlock($key, [[$head], $aligns, $head + 1]);
+                return false;
             }
-
-            return false;
         }
 
         return true;
@@ -1144,7 +1146,7 @@ private function parseBlockMh(?array $block, int $key, string $line, ?array &$st
      */
     private function parseBlockShr(?array $block, int $key, string $line): bool
     {
-        if (preg_match("/^(\* *){3,}\s*$/", $line)) {
+        if (preg_match("/^\*{3,}\s*$/", $line)) {
             $this->startBlock('hr', $key)
                 ->endBlock();
 
@@ -1163,7 +1165,7 @@ private function parseBlockShr(?array $block, int $key, string $line): bool
      */
     private function parseBlockDhr(?array $block, int $key, string $line): bool
     {
-        if (preg_match("/^(- *){3,}\s*$/", $line)) {
+        if (preg_match("/^-{3,}\s*$/", $line)) {
             $this->startBlock('hr', $key)
                 ->endBlock();
 
@@ -1192,7 +1194,7 @@ private function parseBlockDefault(?array $block, int $key, string $line, ?array
             }
         } elseif ($this->isBlock('table')) {
             if (false !== strpos($line, '|')) {
-                $block[3][2] ++;
+                $block[3][2]++;
                 $this->setBlock($key, $block[3]);
             } else {
                 $this->startBlock('normal', $key);
@@ -1270,7 +1272,7 @@ function ($result, $line) {
             }
 
             if (!$moved) {
-                $key ++;
+                $key++;
             }
         }
 
@@ -1312,7 +1314,7 @@ private function parseCode(array $lines, array $parts, int $start): string
             }
 
             return htmlspecialchars($line);
-        }, array_slice($lines, 1, - 1));
+        }, array_slice($lines, 1, -1));
         $str = implode("\n", $this->markLines($lines, $start + 1));
 
         return $isEmpty ? '' :
@@ -1365,7 +1367,7 @@ private function parseAhtml(array $lines, $value, int $start): string
      */
     private function parseShtml(array $lines, $value, int $start): string
     {
-        return trim(implode("\n", $this->markLines(array_slice($lines, 1, - 1), $start + 1)));
+        return trim(implode("\n", $this->markLines(array_slice($lines, 1, -1), $start + 1)));
     }
 
     /**
@@ -1508,7 +1510,7 @@ private function parseTable(array $lines, $value, int $start): string
                 $line = substr($line, 1);
 
                 if ($line[strlen($line) - 1] == '|') {
-                    $line = substr($line, 0, - 1);
+                    $line = substr($line, 0, -1);
                 }
             }
 
@@ -1521,16 +1523,16 @@ private function parseTable(array $lines, $value, int $start): string
                 }
             }, explode('|', $line));
             $columns = [];
-            $last = - 1;
+            $last = -1;
 
             foreach ($rows as $row) {
                 if (strlen($row) > 0) {
-                    $last ++;
+                    $last++;
                     $columns[$last] = [
                         isset($columns[$last]) ? $columns[$last][0] + 1 : 1, $row
                     ];
                 } elseif (isset($columns[$last])) {
-                    $columns[$last][0] ++;
+                    $columns[$last][0]++;
                 } else {
                     $columns[0] = [1, $row];
                 }
@@ -1730,7 +1732,7 @@ private function escapeBracket($str): string
      */
     private function startBlock($type, $start, $value = null): Parser
     {
-        $this->_pos ++;
+        $this->_pos++;
         $this->_current = $type;
 
         $this->_blocks[$this->_pos] = [$type, $start, $start, $value];
@@ -1813,7 +1815,7 @@ private function backBlock($step, $type, $value = null): Parser
         $this->_blocks[$this->_pos][2] = $last - $step;
 
         if ($this->_blocks[$this->_pos][1] <= $this->_blocks[$this->_pos][2]) {
-            $this->_pos ++;
+            $this->_pos++;
         }
 
         $this->_current = $type;
@@ -1840,7 +1842,7 @@ private function combineBlock(): Parser
         $this->_blocks[$this->_pos - 1] = $prev;
         $this->_current = $prev[0];
         unset($this->_blocks[$this->_pos]);
-        $this->_pos --;
+        $this->_pos--;
 
         return $this;
     }
