Skip to content

Commit 88d41b7

Browse files
committed
Fixed toc html header on no heading option
1 parent 04bb4f3 commit 88d41b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

AzureDevOps.WikiPDFExport/WikiPDFExporter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ private string ConvertMarkdownToHTML(List<MarkdownFile> files)
447447
var contents = files.Select(x => x.Content).ToList();
448448
var tocContent = CreateGlobalTableOfContent(contents);
449449
var tocString = string.Join("\n", tocContent);
450+
450451
var tocMarkdownFile = new MarkdownFile { AbsolutePath = tocMDFilePath, Level = 0, RelativePath = relativePath, Content = tocString };
451452
files.Insert(0, tocMarkdownFile);
452453
}
@@ -548,6 +549,13 @@ private string ConvertMarkdownToHTML(List<MarkdownFile> files)
548549
html = heading + html;
549550
}
550551

552+
553+
if (!string.IsNullOrEmpty(_options.GlobalTOC) && i == 0 && !_options.Heading)
554+
{
555+
var heading = $"<h1>{_options.GlobalTOC}</h1>";
556+
html = heading + html;
557+
}
558+
551559
if (_options.Heading)
552560
{
553561
var filename = file.Name.Replace(".md", "");

0 commit comments

Comments
 (0)