jgallen23 / toc

Table of Contents Plugin
http://projects.jga.me/toc/
MIT License
531 stars 111 forks source link

Generation of flat list of ul li has some order problem #80

Open windmaomao opened 6 years ago

windmaomao commented 6 years ago

ok, seems to me right now, all the toc are collected, ex. h2,h3, but when the li is added one by one, we add all h2 and then all h3. Is this a bug ?

   const selectors = el.dataset.toc.split(',').map(s => s.trim());
   selectors.forEach(selector => {
      const items = find(selector, container);

in the old library, jQuery seems to nail this properly

  var headings = $(opts.selectors, container);

so now I wonder if can the new find take a list of tags?

opchen commented 5 years ago

Still have this problem...