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 := "" }} {{- $ref := "" }}
{{ $target := "" }} {{- $target := "" -}}
{{ with .Get "href" }} {{- with .Get "href" -}}
{{ $ref = . }} {{- $ref = . -}}
{{ $target = "_blank" }} {{- $target = "_blank" -}}
{{ end }} {{- end -}}
{{ with .Get "relref" }} {{- with .Get "relref" -}}
{{ $ref = relref $ . }} {{- $ref = relref $ . -}}
{{ end }} {{- end -}}
<a {{ with $ref }} href="{{.}}" {{ end }} {{ with $target }} target="{{.}}" rel="noopener" {{ end }} class="book-btn{{ with .Get "class" }} {{ . }}{{ 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> </a>

View File

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

View File

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