@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Ahc\HtmlUp; |
| 4 | 4 | |
| 5 | -require dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 5 | +require dirname(__DIR__).'/vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | -$markdown = file_get_contents(dirname(__DIR__) . '/readme.md'); |
|
| 7 | +$markdown = file_get_contents(dirname(__DIR__).'/readme.md'); |
|
| 8 | 8 | |
| 9 | 9 | /* You can use any of the three usage methods below */ |
| 10 | 10 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $markup = $this->images($markup); |
| 47 | 47 | |
| 48 | - return \preg_replace_callback(static::RE_MD_URL, function ($a) { |
|
| 48 | + return \preg_replace_callback(static::RE_MD_URL, function($a) { |
|
| 49 | 49 | $title = isset($a[3]) ? " title={$a[3]} " : ''; |
| 50 | 50 | |
| 51 | 51 | return "<a href=\"{$a[2]}\"{$title}>{$a[1]}</a>"; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | protected function images($markup) |
| 56 | 56 | { |
| 57 | - return \preg_replace_callback(static::RE_MD_IMG, function ($img) { |
|
| 57 | + return \preg_replace_callback(static::RE_MD_IMG, function($img) { |
|
| 58 | 58 | $title = isset($img[3]) ? " title={$img[3]} " : ''; |
| 59 | 59 | $alt = $img[1] ? " alt=\"{$img[1]}\" " : ''; |
| 60 | 60 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | protected function spans($markup) |
| 66 | 66 | { |
| 67 | 67 | // em/code/strong/del |
| 68 | - return \preg_replace_callback(static::RE_MD_FONT, function ($em) { |
|
| 68 | + return \preg_replace_callback(static::RE_MD_FONT, function($em) { |
|
| 69 | 69 | switch (\substr($em[1], 0, 2)) { |
| 70 | 70 | case '**': |
| 71 | 71 | case '__': |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $level = \strlen($this->trimmedLine) - \strlen(\ltrim($this->trimmedLine, '#')); |
| 220 | 220 | |
| 221 | 221 | if ($level < 7) { |
| 222 | - $this->markup .= "\n<h{$level}>" . \ltrim(\ltrim($this->trimmedLine, '# ')) . "</h{$level}>"; |
|
| 222 | + $this->markup .= "\n<h{$level}>".\ltrim(\ltrim($this->trimmedLine, '# '))."</h{$level}>"; |
|
| 223 | 223 | |
| 224 | 224 | return \true; |
| 225 | 225 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | if ($codeBlock || (!$this->inList && !$this->inQuote && $isShifted)) { |
| 248 | 248 | $lang = isset($codeMatch[1]) |
| 249 | - ? ' class="language-' . $codeMatch[1] . '"' |
|
| 249 | + ? ' class="language-'.$codeMatch[1].'"' |
|
| 250 | 250 | : ''; |
| 251 | 251 | |
| 252 | 252 | $this->markup .= "\n<pre><code{$lang}>"; |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $this->listLevel++; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - $this->markup .= '<li>' . \ltrim($this->trimmedLine, '+-*0123456789. '); |
|
| 312 | + $this->markup .= '<li>'.\ltrim($this->trimmedLine, '+-*0123456789. '); |
|
| 313 | 313 | |
| 314 | 314 | $this->listInternal(); |
| 315 | 315 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | $this->trimmedLine = \trim($this->trimmedLine, '|'); |
| 396 | 396 | |
| 397 | 397 | foreach (\explode('|', $this->trimmedLine) as $hdr) { |
| 398 | - $this->markup .= '<th>' . \trim($hdr) . "</th>\n"; |
|
| 398 | + $this->markup .= '<th>'.\trim($hdr)."</th>\n"; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | $this->markup .= "</tr>\n</thead>\n<tbody>\n"; |