Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function process(Page $page, string $output, string $format): string |
||
31 | { |
||
32 | if ($format == 'html') { |
||
33 | // https://regex101.com/r/Xl7d5I/3 |
||
34 | $pattern = '(.*)(<!--[[:blank:]]?(excerpt|break)[[:blank:]]?-->)(.*)'; |
||
35 | $replacement = '$1<span id="more"></span>$4'; |
||
36 | $excerpt = preg_replace('/' . $pattern . '/is', $replacement, $output, 1); |
||
37 | $output = $excerpt ?? $output; |
||
38 | } |
||
39 | |||
40 | return $output; |
||
41 | } |
||
43 |