Unverified Commit 006dae12 authored by IndieRodo's avatar IndieRodo Committed by GitHub

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
parent 5c07ce0a
...@@ -530,12 +530,13 @@ export default { ...@@ -530,12 +530,13 @@ export default {
} }
} }
// -> Handle anchor links within the page contents
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.container.querySelectorAll(`a[href^="#"], a[href^="${window.location.href.replace(window.location.hash, '')}#"]`).forEach(el => { this.$refs.container.querySelectorAll(`a[href^="#"], a[href^="${window.location.href.replace(window.location.hash, '')}#"]`).forEach(el => {
el.onclick = ev => { el.onclick = ev => {
ev.preventDefault() ev.preventDefault()
ev.stopPropagation() ev.stopPropagation()
this.$vuetify.goTo(ev.target.hash, this.scrollOpts) this.$vuetify.goTo(decodeURIComponent(ev.target.hash), this.scrollOpts)
} }
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment