@@ -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 '__': |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | if ($level < 7) { |
| 28 | - return "\n<h{$level}>" . \ltrim(\ltrim($line, '# ')) . "</h{$level}>"; |
|
| 28 | + return "\n<h{$level}>".\ltrim(\ltrim($line, '# '))."</h{$level}>"; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | return ''; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | public function codeStart($lang) |
| 35 | 35 | { |
| 36 | 36 | $lang = isset($lang[1]) |
| 37 | - ? ' class="language-' . $lang[1] . '"' |
|
| 37 | + ? ' class="language-'.$lang[1].'"' |
|
| 38 | 38 | : ''; |
| 39 | 39 | |
| 40 | 40 | return "\n<pre><code{$lang}>"; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $table = "<table>\n<thead>\n<tr>\n"; |
| 46 | 46 | |
| 47 | 47 | foreach (\explode($delim, \trim($line, $delim)) as $hdr) { |
| 48 | - $table .= '<th>' . \trim($hdr) . "</th>\n"; |
|
| 48 | + $table .= '<th>'.\trim($hdr)."</th>\n"; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $table .= "</tr>\n</thead>\n<tbody>\n"; |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | $this->listLevel++; |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - $this->markup .= '<li>' . \ltrim($this->trimmedLine, '+-*0123456789. '); |
|
| 171 | + $this->markup .= '<li>'.\ltrim($this->trimmedLine, '+-*0123456789. '); |
|
| 172 | 172 | |
| 173 | 173 | $this->listInternal(); |
| 174 | 174 | |