exclude headings inside pre, code or iframe tags
jonschlinkert opened this issue · comments
Jon Schlinkert commented
https://github.com/assemble/assemble-contrib-toc/blob/master/index.js#L41
I'm not sure of the best approach or of jquery/cheerio conventions, but maybe something like this will work:
var anchors = $('h1 a[name],h2 a[name],h3 a[name],h4 a[name]');
anchors = $(anchors(':not("pre,code,iframe")'));