Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | protected function transform():string{ |
||
26 | |||
27 | if(empty($this->content)){ |
||
28 | return ''; |
||
29 | } |
||
30 | |||
31 | $str = [ |
||
32 | 'b' => '**', // bold |
||
33 | 'c' => '`', // inline code |
||
34 | 'del' => '~~', // strikethrough |
||
35 | 'em' => '_', // italic |
||
36 | 'i' => '_', // italic |
||
37 | 's' => '~~', // strikethrough |
||
38 | 'strong' => '**', // bold |
||
39 | ][$this->tag]; |
||
40 | |||
41 | return $str.$this->content.$str; |
||
42 | } |
||
43 | |||
45 |