From ccb57703a65f9634c044815ff281678cc2cc834f Mon Sep 17 00:00:00 2001 From: Steven Engler Date: Fri, 29 Mar 2024 01:49:44 -0400 Subject: [PATCH] Fixed table of contents regex This was broken by a change in some old Hugo version. --- layouts/_default/single.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index af1839a..f7b5f31 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -22,8 +22,8 @@ {{ $toc := .TableOfContents -}} {{/* Workaround for an extra layer of indentation (https://discourse.gohugo.io/t/2303) */}} - {{- $toc := replaceRE `(\s?)${1}` $toc -}} + {{- $toc := replaceRE `(\s*)
    \s*
  • \s*
      ` `${2}
        ` $toc -}} + {{- $toc := replaceRE `
      \s*\s*
    (\s*)` `
${1}` $toc -}} {{- safeHTML $toc }}