From 35ccaa287e7749b646a2b7d4c9ea0bf1b04fa650 Mon Sep 17 00:00:00 2001 From: Zachary Betz Date: Tue, 26 Feb 2019 10:16:01 -0600 Subject: [PATCH] Handle non-ascii chars in toc id --- layouts/partials/toc.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 39c3cb2..86ee3b6 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -5,7 +5,11 @@
    {{ range $headings }}
  1. - + {{ $id := findRE "id=\".*\"" . }} + {{ $id = index $id 0 }} + {{ $id = strings.TrimPrefix "id=\"" $id }} + {{ $id = strings.TrimSuffix "\"" $id }} + {{ . | htmlUnescape | plainify }}