@@ -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 '__': |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | if ($codeBlock || (!$this->inList && !$this->inQuote && $isShifted)) { |
108 | 108 | $lang = isset($codeMatch[1]) |
109 | - ? ' class="language-' . $codeMatch[1] . '"' |
|
109 | + ? ' class="language-'.$codeMatch[1].'"' |
|
110 | 110 | : ''; |
111 | 111 | |
112 | 112 | $this->markup .= "\n<pre><code{$lang}>"; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $this->listLevel++; |
173 | 173 | } |
174 | 174 | |
175 | - $this->markup .= '<li>' . \ltrim($this->trimmedLine, '+-*0123456789. '); |
|
175 | + $this->markup .= '<li>'.\ltrim($this->trimmedLine, '+-*0123456789. '); |
|
176 | 176 | |
177 | 177 | $this->listInternal(); |
178 | 178 |
@@ -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 ''; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $table = "<table>\n<thead>\n<tr>\n"; |
37 | 37 | |
38 | 38 | foreach (\explode($delim, \trim($line, $delim)) as $hdr) { |
39 | - $table .= '<th>' . \trim($hdr) . "</th>\n"; |
|
39 | + $table .= '<th>'.\trim($hdr)."</th>\n"; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $table .= "</tr>\n</thead>\n<tbody>\n"; |