Closed Uzay-G closed 3 years ago
I believe that pre-processing the markdown content with a HOC seems to be a better way to achieve this. Something like:
function inject_toc_on_top (md) {
return ['[TOC]','',md].join('\n')
}
let markdown_content = '# Header'
markdownIt.render(inject_toc_on_top (markdown_content))
No reason to address this as an option. Developers have the freedom to decide.
Hi,
I was wondering if it would be possible to add an option to automatically add the table of contents at the beginning of the content. This would be nice instead of manually adding it to the beginning of everything you render.
Thanks!