From 006dae122187ffce9f6a9fb7680bebae2e12a94d Mon Sep 17 00:00:00 2001 From: IndieRodo <13654429+indierodo@users.noreply.github.com> Date: Sat, 30 May 2020 12:10:44 -0500 Subject: [PATCH] fix: links to subtitles with special characters (#1949) This issue is related to #1006 . The $vuetify.goTo() function expects a UTF-8 ev.target.hash . However, the markdown CRM URIencodes the ev.target.hash (this is great for browser compatibility, not so much for Vuetify) Adding decodeURIComponent() to ev.target.hash fixes compatibility with Vuetify. This fixes GitHub issue #1873 --- client/themes/default/components/page.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/themes/default/components/page.vue b/client/themes/default/components/page.vue index b460999a..030b50d2 100644 --- a/client/themes/default/components/page.vue +++ b/client/themes/default/components/page.vue @@ -530,12 +530,13 @@ export default { } } + // -> Handle anchor links within the page contents this.$nextTick(() => { this.$refs.container.querySelectorAll(`a[href^="#"], a[href^="${window.location.href.replace(window.location.hash, '')}#"]`).forEach(el => { el.onclick = ev => { ev.preventDefault() ev.stopPropagation() - this.$vuetify.goTo(ev.target.hash, this.scrollOpts) + this.$vuetify.goTo(decodeURIComponent(ev.target.hash), this.scrollOpts) } }) })