diff --git a/assets/scss/heading-anchor.scss b/assets/scss/heading-anchor.scss index 70a0b69..4fc9aeb 100644 --- a/assets/scss/heading-anchor.scss +++ b/assets/scss/heading-anchor.scss @@ -1,6 +1,9 @@ // (C) 2023 GoodData Corporation .heading-with-anchor { + .nowrapper { + white-space: nowrap; + } .anchor-wrapper { opacity: 0; display: inline-flex; diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index c8f97fe..0ae3553 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1,22 +1,30 @@ {{/* (C) 2023 GoodData Corporation */}} {{ $cleanText := replaceRE "\\s+" " " (htmlUnescape .Text) }} +{{ $words := split $cleanText " " }} +{{ $lastWord := index $words (sub (len $words) 1)}} +{{ $withoutLast := substr $cleanText 0 (sub (len $cleanText) (add (len $lastWord) 1)) }} - {{ .Text | safeHTML }} - {{- if in (slice 2 3 4 6) .Level }}{{" " -}} - - - {{ with resources.Get "icons/icon-anchor.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }} - - - {{- end -}} + {{- $withoutLast | safeHTML -}} + + {{- $lastWord | safeHTML -}} + {{- if in (slice 2 3 4 6) .Level }}{{" " -}} + + + {{ with resources.Get "icons/icon-anchor.svg" }} + {{ ( . | minify).Content | safeHTML }} + {{ end }} + + + {{- end -}} + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6487040..a8c96d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "gdc-docs-theme", + "name": "gooddata-docs-theme", "lockfileVersion": 2, "requires": true, "packages": {