Skip to content

Commit 52702d5

Browse files
authored
Protect against asciidoc headers (#843)
``` [source,esql] ---- ```
1 parent c9ba320 commit 52702d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Elastic.Markdown/IO/MarkdownFile.cs

+1
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ public static List<PageTocItem> GetAnchors(
281281
.Descendants<HeadingBlock>()
282282
.Where(block => block is { Level: >= 2 })
283283
.Select(h => (h.GetData("header") as string, h.GetData("anchor") as string, h.Level))
284+
.Where(h => h.Item1 is not null)
284285
.Select(h =>
285286
{
286287
var header = h.Item1!.StripMarkdown();

0 commit comments

Comments
 (0)