@@ -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 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $markup = $this->images($markup); |
56 | 56 | |
57 | - return \preg_replace_callback(static::RE_MD_URL, function ($a) { |
|
57 | + return \preg_replace_callback(static::RE_MD_URL, function($a) { |
|
58 | 58 | $title = isset($a[3]) ? " title={$a[3]} " : ''; |
59 | 59 | |
60 | 60 | return "<a href=\"{$a[2]}\"{$title}>{$a[1]}</a>"; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | protected function images($markup) |
65 | 65 | { |
66 | - return \preg_replace_callback(static::RE_MD_IMG, function ($img) { |
|
66 | + return \preg_replace_callback(static::RE_MD_IMG, function($img) { |
|
67 | 67 | $title = isset($img[3]) ? " title={$img[3]} " : ''; |
68 | 68 | $alt = $img[1] ? " alt=\"{$img[1]}\" " : ''; |
69 | 69 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | protected function spans($markup) |
75 | 75 | { |
76 | 76 | // em/code/strong/del |
77 | - return \preg_replace_callback(static::RE_MD_FONT, function ($em) { |
|
77 | + return \preg_replace_callback(static::RE_MD_FONT, function($em) { |
|
78 | 78 | switch (\substr($em[1], 0, 2)) { |
79 | 79 | case '**': |
80 | 80 | 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"; |