Do not include excluded headlines when calculating headline index

This commit is contained in:
Niklas Fasching 2024-08-20 15:22:59 +02:00
parent d4f684b248
commit 7bc6100fc7
3 changed files with 20 additions and 21 deletions

View file

@ -260,7 +260,9 @@ func (d *Document) parseMany(i int, stop stopFn) (int, []Node) {
func (d *Document) addHeadline(headline *Headline) int {
current := &Section{Headline: headline}
d.Outline.last.add(current)
d.Outline.count++
if !headline.IsExcluded(d) {
d.Outline.count++
}
d.Outline.last = current
return d.Outline.count
}