Use .InnerDeindent in inline shortcodes

This commit is contained in:
Alex Shpak 2024-10-02 12:02:41 +02:00
parent 2b7b9c3c79
commit 35bf672b70
3 changed files with 12 additions and 12 deletions

View File

@ -1,12 +1,12 @@
{{ $ref := "" }}
{{ $target := "" }}
{{ with .Get "href" }}
{{ $ref = . }}
{{ $target = "_blank" }}
{{ end }}
{{ with .Get "relref" }}
{{ $ref = relref $ . }}
{{ end }}
{{- $ref := "" }}
{{- $target := "" -}}
{{- with .Get "href" -}}
{{- $ref = . -}}
{{- $target = "_blank" -}}
{{- end -}}
{{- with .Get "relref" -}}
{{- $ref = relref $ . -}}
{{- end -}}
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" rel="noopener" {{ end }} class="book-btn{{ with .Get "class" }} {{ . }}{{ end }}">
{{ .Inner | .Page.RenderString }}
{{ .InnerDeindent | .Page.RenderString }}
</a>

View File

@ -2,6 +2,6 @@
{{- $summary := cond .IsNamedParams (.Get "title") (.Get 0) -}}
<summary>{{ $summary | .Page.RenderString }}</summary>
<div class="markdown-inner">
{{ .Inner | .Page.RenderString }}
{{ .InnerDeindent | .Page.RenderString }}
</div>
</details>

View File

@ -1,3 +1,3 @@
<blockquote class="book-hint {{ .Get 0 }}">
{{ .Inner | .Page.RenderString }}
{{ .InnerDeindent | .Page.RenderString }}
</blockquote>