Skip to content

Commit

Permalink
Merge pull request #564 from stevencohn/554-fix-insert-toc-starting-i…
Browse files Browse the repository at this point in the history
…ndex

allow TOC to start at non-level-1 heading
  • Loading branch information
stevencohn committed Aug 22, 2022
2 parents e518eb0 + 3418bc1 commit ddf6a3c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OneMore/Commands/Snippets/InsertTocCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ private async Task InsertToc(Page page, bool jumplinks, bool alignlinks)
{
var children = new XElement(PageNamespace.Value + "OEChildren");
BuildHeadings(children, headings, ref index, heading.Level, dark);
if (!container.Elements().Any())
{
container.Add(new Paragraph());
}

container.Elements().Last().Add(children);
index--;
}
Expand Down

0 comments on commit ddf6a3c

Please sign in to comment.