Perf: use .RenderString instead of markdownify (#105)

This commit is contained in:
Cell
2022-05-14 12:54:33 +08:00
parent 05dd048b0a
commit 1e20aaedab
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
{{- $type := .Get "type" | default "note" -}}
<div class="details admonition {{ $type }}{{ if .Get `open` | ne false }} open{{ end }}">
<div class="details-summary admonition-title">
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | markdownify | default (T $type) }}<i class="details-icon {{ $iconDetails }}"></i>
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | .Page.RenderString | default (T $type) }}<i class="details-icon {{ $iconDetails }}"></i>
</div>
<div class="details-content">
<div class="admonition-content">
@@ -30,7 +30,7 @@
{{- $type := .Get 0 | default "note" -}}
<div class="details admonition {{ $type }}{{ if .Get 2 | ne false }} open{{ end }}">
<div class="details-summary admonition-title">
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | markdownify | default (T $type) }}<i class="details-icon {{ $iconDetails }}"></i>
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | .Page.RenderString | default (T $type) }}<i class="details-icon {{ $iconDetails }}"></i>
</div>
<div class="details-content">
<div class="admonition-content">
+2 -2
View File
@@ -1,4 +1,4 @@
<details>
<summary>{{ .Get "summary" | default (.Get 0) | markdownify }}</summary>
{{ .Inner | markdownify }}
<summary>{{ .Get "summary" | default (.Get 0) | .Page.RenderString }}</summary>
{{ .Inner | .Page.RenderString }}
</details>