fix: ensure render template contains no empty newlines (#76)
parent
10e95b8c7b
commit
798a2679c1
|
@ -1,6 +1,6 @@
|
||||||
{{ $showAnchor := (and (default true .Page.Params.GeekdocAnchor) (default true .Page.Site.Params.GeekdocAnchor)) }}
|
{{- $showAnchor := (and (default true .Page.Params.GeekdocAnchor) (default true .Page.Site.Params.GeekdocAnchor)) -}}
|
||||||
|
|
||||||
{{ if $showAnchor }}
|
{{- if $showAnchor -}}
|
||||||
<div class="gdoc-page__anchorwrap">
|
<div class="gdoc-page__anchorwrap">
|
||||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||||
{{ .Text | safeHTML }}
|
{{ .Text | safeHTML }}
|
||||||
|
@ -9,10 +9,10 @@
|
||||||
</a>
|
</a>
|
||||||
</h{{ .Level }}>
|
</h{{ .Level }}>
|
||||||
</div>
|
</div>
|
||||||
{{ else }}
|
{{- else -}}
|
||||||
<div class="gdoc-page__anchorwrap">
|
<div class="gdoc-page__anchorwrap">
|
||||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||||
{{ .Text | safeHTML }}
|
{{ .Text | safeHTML }}
|
||||||
</h{{ .Level }}>
|
</h{{ .Level }}>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
<img src="{{ .Destination | safeURL | relURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
<img src="{{ .Destination | safeURL | relURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />
|
||||||
|
{{- /* Drop trailing newlines */ -}}
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
|
||||||
<a class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
|
<a class="gdoc-markdown__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||||
|
{{- /* Drop trailing newlines */ -}}
|
||||||
|
|
Loading…
Reference in New Issue