daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. console.log(
  2.   '\n\n\n> **Table of contents**\n> \n' +
  3.   Array.from(document.querySelectorAll('h1 > a, h2 > a, h3 > a')).map((a) => (
  4.     {'H1':'> * ','H2':'>   * ','H3':'>     - '}[a.parentNode.tagName] +
  5.     `[${a.parentNode.innerText.trim()}](${a.hash})`
  6.   )).join('\n') +
  7.   '\n\n\n'
  8. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top