Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | */ |
||
39 | public function parse($text) |
||
40 | { |
||
41 | $text = $this->hashBlock($text, ['code', 'a']); |
||
42 | $text = $this->hashInline($text, 'img'); |
||
43 | |||
44 | $text = Pattern::template('(?<=^|[\n \>]|\.)(@)') |
||
45 | ->alteration(array_keys($this->smilies)) |
||
46 | ->build() |
||
47 | ->replace($text) |
||
48 | ->callback(function (Detail $match) { |
||
49 | $smiley = $match->get(1); |
||
50 | $link = $this->smilies[$smiley]; |
||
51 | return '<img class="img-smile" alt="' . $smiley . '" title="' . $smiley . '" src="/img/smilies/' . $link . '">'; |
||
52 | }); |
||
53 | |||
54 | $text = $this->unhash($text); |
||
55 | |||
59 |