Open huanglw opened 6 years ago
you may need this:
wrapper the provided html, and add some script:
<script>
// add a basic TOC for markdown-js
const headers = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
headers.forEach((value, index, array) => {
const tags = document.getElementsByTagName(value);
for (let index = 0; index < tags.length; index++) {
tags[index].setAttribute('id', tags[index].innerText);
}
});
</script>
It seems not support "[TOC]" default?