@props([ 'text', ]) @php /** * Splits a translated string into masked word spans so titles can rise word by word. * Words stay separated by a single literal space, so the rendered text is unchanged. */ $words = preg_split('/\s+/u', trim((string) $text)) ?: []; $html = implode(' ', array_map( fn (string $word, int $index): string => ''.e($word).'', $words, array_keys($words), )); @endphp {!! $html !!}