mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
theme: harmonize whitespace regex
This commit is contained in:
parent
0cb97716e0
commit
215c65ae50
5 changed files with 5 additions and 5 deletions
|
@ -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 }}
|
|
@ -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 }}
|
|
@ -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>
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue