Skip to content

Commit

Permalink
fixup! Ensure that doc url hash IDs are scrolled to on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazhafiz authored and calebcartwright committed Aug 18, 2021
1 parent bf47fc1 commit f5c782f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/index.html
Expand Up @@ -161,16 +161,14 @@
</h${level}>`;
};

const html = marked.parser(ast, {
return marked.parser(ast, {
highlight(code, lang) {
return hljs.highlight(lang ? lang : 'rust', code).value;
},
headerIds: true,
headerPrefix: '',
renderer,
});
document.dispatchEvent(new Event('htmlbuilt'));
return html;
}
},
created: async function() {
Expand All @@ -181,7 +179,7 @@
.filter(tag => tag.startsWith('v'));
this.versionOptions = this.versionOptions.concat(tagOptions);
},
updated: function() {
updated() {
if (UrlHash === '') return;
this.$nextTick(() => {
const target = document.querySelector(`#${UrlHash}`);
Expand Down

0 comments on commit f5c782f

Please sign in to comment.