'escape', 'allow_unsafe_links' => false, 'external_link' => [ 'internal_hosts' => array_values(array_filter([$host, ...(array) config('manager.markdown.internal_hosts', [])])), 'open_in_new_window' => true, 'noopener' => 'external', 'noreferrer' => 'external', ], ], [new ExternalLinkExtension]); } public static function toPlainText(string $markdown): string { $text = strip_tags(self::toHtml($markdown)); return trim((string) preg_replace('/\s+/', ' ', html_entity_decode($text, ENT_QUOTES | ENT_HTML5))); } }