, tagi) są konwertowane na plain text. */ function normalizeQueueMessageText(string $text): string { $text = trim($text); if ($text === '') { return ''; } $text = preg_replace('//i', "\n", $text) ?? $text; $text = html_entity_decode(strip_tags($text), ENT_QUOTES | ENT_HTML5, 'UTF-8'); $text = str_replace(["\r\n", "\r"], "\n", $text); $text = preg_replace("/\n{3,}/", "\n\n", $text) ?? $text; return trim($text); }