tscanlin / tocbot

Build a table of contents from headings in an HTML document.
MIT License
1.39k stars 115 forks source link

Ignore header tags with no ids #331

Closed sivaram10111998 closed 6 months ago

sivaram10111998 commented 7 months ago

Currently when a new line is added which is of type header and without any text, it shows up in the toc with an empty bullet point. So can we get a way to ignore the header tags that don't have any id. Eg: < h1>&nbsp< /h1> Even though above tag don't have any content and id, it's being shown in toc.

tscanlin commented 7 months ago

Why are you including a heading with no content in it in the first place? Maybe there's some use case I'm missing but that wouldn't seem to be very semantic to me. Maybe it could be removed instead?