diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index cadae2d..de2a930 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -30,7 +30,8 @@ {{ else }} {{/* Multiple words - split to prevent line break in last word */}} {{ $lastWord := index $words (sub $wordCount 1) }} - {{ $withoutLast := substr $cleanText 0 (sub (len $cleanText) (add (len $lastWord) 1)) }} + {{ $wordsWithoutLast := first (sub $wordCount 1) $words }} + {{ $withoutLast := delimit $wordsWithoutLast " " }} {{- $withoutLast | safeHTML }} {{- $lastWord | safeHTML -}}