From fb6094a1b8b00f65e4229aa28f02b695f7be7bb9 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 25 Sep 2023 22:37:38 +0200 Subject: [PATCH] improve slugify function --- server/public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/public/index.html b/server/public/index.html index 65b7b3c..e4448d2 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -48,7 +48,8 @@ ariaHidden: true }), // prepend current file id to the anchor permalink - slugify: s => `${getId() ?? ""}-${encodeURIComponent(String(s).trim().toLowerCase().replace(/\s+/g, "-").replace(/[^A-Za-z0-9_-]/g, ""))}` + slugify: s => `${getId() ?? ""}-${encodeURIComponent(String(s).trim().toLowerCase().normalize("NFKD").replace(/\p{M}/g, "").replace(/\s+/g, "-").replace(/[^a-z0-9_-]/g, "") + )}` }); md.use(markdownitFootnote);