setPriority("markup_text", 4); } public function markup_text($text): string { $urls = array( '||i' => 'https://www.youtube.com/embed/$1', '||i' => 'https://www.youtube.com/embed/$1', '||i' => 'https://player.vimeo.com/video/$1', '||i' => 'https://player.twitch.tv/?video=v$1', '||i' => 'https://archive.org/embed/$1' ); foreach ($urls as $view => &$embed) $embed = ''; return preg_replace(array_keys($urls), array_values($urls), $text); } }