Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log(
- '\n\n\n> **Table of contents**\n> \n' +
- Array.from(document.querySelectorAll('h1 > a, h2 > a, h3 > a')).map((a) => (
- {'H1':'> * ','H2':'> * ','H3':'> - '}[a.parentNode.tagName] +
- `[${a.parentNode.innerText.trim()}](${a.hash})`
- )).join('\n') +
- '\n\n\n'
- );
Add Comment
Please, Sign In to add comment