[!SUMMARY]- Table of Contents <%*
const headers = await tp.file.content .split('\n') // split file into lines .filter(t => t.match(/^[#]+\s+/gi)) // only get headers .map(h => { const headerLevel = h.split(' ')[0].match(/#/g).length; // get header text without special characters like '[' and ']'