'How to have a "md-sidebar-toc" button in html generated by markdown-preview-enhanced in vscode?
I hope that when a HTML is generated by markdown-preview-enhanced in vscode, there could be a button whose id is 'md-sidebar-toc'(in fact it is a div with lots of ul and li) in the HTML. How to change my settings? The button looks like enter image description here And the script may be similar to
<script>
var sidebarTOCBtn = document.getElementById('sidebar-toc-btn')
sidebarTOCBtn.addEventListener('click', function(event) {
event.stopPropagation()
if (document.body.hasAttribute('html-show-sidebar-toc')) {
document.body.removeAttribute('html-show-sidebar-toc')
} else {
document.body.setAttribute('html-show-sidebar-toc', true)
}
})
</script>
Solution 1:[1]
The setting "markdown-preview-enhanced: Enable Script Excution" should be switched on.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Photon |
