Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/VincentTam/huginn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Tam <sere@live.hk>2019-08-01 00:27:01 +0300
committerVincent Tam <sere@live.hk>2019-08-01 00:27:01 +0300
commit15fc33d78b495dafff7f2c3b78cca628bc3bfc98 (patch)
tree86da3f59a78eca78300b719aae996a6890c18f7a
parent68c2a6962ed8ab02239dfaf6179fd54e1e7a15eb (diff)
Applied @user501254's fix
https://github.com/gohugoio/hugo/issues/1778#issuecomment-483880269
-rw-r--r--layouts/_default/single.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 24f4dd5..1584dcf 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -49,7 +49,9 @@
{{ if .TableOfContents }}
<details>
<summary>{{ i18n "toc" }}</summary>
- {{- .TableOfContents -}}
+ {{- $emtLiPtrn := "(?s)<ul>\\s<li>\\s<ul>(.*)</li>\\s</ul>" -}}
+ {{- $rplcEmtLi := "<ul>$1" -}}
+ {{ .TableOfContents | replaceRE $emtLiPtrn $rplcEmtLi | safeHTML }}
</details>
{{- end -}}
{{- .Content -}}