From 96a31fe3551dd17ea655cb314637b5008425a12d Mon Sep 17 00:00:00 2001 From: maliming Date: Mon, 16 Mar 2020 14:58:33 +0800 Subject: [PATCH] Fix unicode anchor links. Fix #3119 --- .../src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js index 1149bb500d..1b0246f2bb 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Scripts/vs.js @@ -47,7 +47,7 @@ return; } - var $targetElement = $(hash); + var $targetElement = $(decodeURIComponent(hash)); $targetElement = $targetElement.length ? $targetElement : $('[name=' + this.hash.slice(1) + ']'); @@ -77,7 +77,7 @@ event.preventDefault(); var hash = this.hash; $('html, body').animate({ - scrollTop: $(hash).offset().top + scrollTop: $(decodeURIComponent(hash)).offset().top }, 500, function () { window.location.hash = hash; });