theme: harmonize whitespace regex

This commit is contained in:
Sören Weber 2024-09-01 20:37:58 +02:00
parent 0cb97716e0
commit 215c65ae50
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 5 additions and 5 deletions

View file

@ -1,3 +1,3 @@
{{- $content := .content }}
{{- $indention := .indention }}
{{- replaceRE "(\\r\\n|\\r|\\n)" (printf "$1%s" $indention) (replaceRE "^" $indention (trim $content " \n\r\t")) | safeHTML }}
{{- replaceRE "(\\r\\n|\\r|\\n)" (printf "$1%s" $indention) (replaceRE "^" $indention (trim $content "\n\r\t ")) | safeHTML }}

View file

@ -23,7 +23,7 @@
<i class="expander-icon fa-fw fas fa-chevron-right"></i> {{ $title | .RenderString }}
</label>
<div id="R-expandcontent-{{ $id }}" class="expand-content">
{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
{{ if ne "<" (substr (strings.TrimLeft "\n\r\t " $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
</div>
{{- end }}

View file

@ -59,7 +59,7 @@
{{- end }}
{{- if $hasContent }}
<div{{ if $expander }} id="R-expandcontent-{{ $id }}"{{ end }} class="{{ if $expander }}expand-content {{ end }}box-content">
{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
{{ if ne "<" (substr (strings.TrimLeft "\n\r\t " $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
{{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
{{- end }}
</div>

View file

@ -95,7 +95,7 @@
data-tab-item="{{ .itemid }}"
class="tab-content tab-panel-style cstyle {{ .style }}{{ cond (eq $idx 0) " active" ""}}"{{ if .color }} style="--VARIABLE-BOX-color: {{ .color }};"{{ end }}>
<div class="tab-content-text">
{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" .content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
{{ if ne "<" (substr (strings.TrimLeft "\n\r\t " .content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
{{ .content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
</div>
{{- end }}

View file

@ -14,7 +14,7 @@
{{- end }}
{{- $lastCapital = $capital }}
{{- end }}
{{- $toc := trim (partial "toc.html" .) " \n\r\t" }}
{{- $toc := trim (partial "toc.html" .) "\n\r\t " }}
{{- if and (not $toc) $toc_pages }}
{{- $toc = printf "<nav id=\"TableOfContents\"></nav>" }}
{{- end }}