Fix outline nesting

oops - that got lost during the rebase - here we go
This commit is contained in:
Niklas Fasching 2018-12-26 17:42:59 +01:00
parent 141d6a27a9
commit 940b1c7125
2 changed files with 15 additions and 5 deletions

View file

@ -255,8 +255,10 @@ func (d *Document) addFootnote(name string, definition *FootnoteDefinition) {
} }
func (d *Document) addHeadline(headline *Headline) int { func (d *Document) addHeadline(headline *Headline) int {
d.Outline.last.add(&Section{Headline: headline}) current := &Section{Headline: headline}
d.Outline.last.add(current)
d.Outline.count++ d.Outline.count++
d.Outline.last = current
return d.Outline.count return d.Outline.count
} }

View file

@ -2,7 +2,7 @@
<ul> <ul>
<li> <li>
<a href="#headline-1">issues from goorgeous (free test cases, yay!)</a> <a href="#headline-1">issues from goorgeous (free test cases, yay!)</a>
</li> <ul>
<li> <li>
<a href="#headline-2">#19: Support #+HTML</a> <a href="#headline-2">#19: Support #+HTML</a>
</li> </li>
@ -41,34 +41,42 @@
</li> </li>
<li> <li>
<a href="#headline-14">#82: Crash on empty headline</a> <a href="#headline-14">#82: Crash on empty headline</a>
</li> <ul>
<li> <li>
<a href="#headline-15"></a> <a href="#headline-15"></a>
</li> </li>
</ul>
</li>
<li> <li>
<a href="#headline-16">#84: Paragraphs that are not followed by an empty line are not parsed correctly</a> <a href="#headline-16">#84: Paragraphs that are not followed by an empty line are not parsed correctly</a>
</li> <ul>
<li> <li>
<a href="#headline-17">Foo</a> <a href="#headline-17">Foo</a>
</li> </li>
<li> <li>
<a href="#headline-18">Bar</a> <a href="#headline-18">Bar</a>
</li> </li>
</ul>
</li>
<li> <li>
<a href="#headline-19">#86: Multiple hyphens not converted to dashes</a> <a href="#headline-19">#86: Multiple hyphens not converted to dashes</a>
</li> </li>
<li> <li>
<a href="#headline-20">#87: Markup in footnotes is rendered literally</a> <a href="#headline-20">#87: Markup in footnotes is rendered literally</a>
</li> </li>
</ul>
</li>
<li> <li>
<a href="#headline-21">issues (wrongly) filed with hugo</a> <a href="#headline-21">issues (wrongly) filed with hugo</a>
</li> <ul>
<li> <li>
<a href="#headline-22">#3874 exporting images in org mode</a> <a href="#headline-22">#3874 exporting images in org mode</a>
</li> </li>
<li> <li>
<a href="#headline-23">#4006 source code blocks in org not rendered correctly</a> <a href="#headline-23">#4006 source code blocks in org not rendered correctly</a>
</li> </li>
</ul>
</li>
<li> <li>
<a href="#headline-24">Footnotes</a> <a href="#headline-24">Footnotes</a>
</li> </li>