19declare(strict_types=1);
39 return $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform($text);
44 $text = str_replace(self::PLACEHOLDER_START,
'',
$text);
45 $text = str_replace(self::PLACEHOLDER_END,
'',
$text);
47 self::HIGHLIGHT_START,
49 self::PLACEHOLDER_START,
50 self::PLACEHOLDER_END,
59 self::PLACEHOLDER_START,
60 self::PLACEHOLDER_END,
61 self::HIGHLIGHT_START,
70 string $replace_start,
74 $regex =
'/' . preg_quote($search_start,
'/') .
'(.*?)' . preg_quote($search_end,
'/') .
'/m';
75 $replacement = $replace_start .
'$1' . $replace_end;
76 return preg_replace($regex, $replacement,
$text);
const string PLACEHOLDER_END
replacePlaceholders(string $html)
const string HIGHLIGHT_START
const string HIGHLIGHT_END
const string PLACEHOLDER_START
replaceInPairs(string $search_start, string $search_end, string $replace_start, string $replace_end, string $text)
__construct(protected Refinery $refinery)
sanitizeAndSetUpPlaceholders(string $text)