diff options
-rw-r--r-- | layouts/_default/single.html | 4 |
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 -}} |