Skip to content

Commit 4d024c7

Browse files
committed
Find every HeadingBlock in a document
1 parent 764e19a commit 4d024c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Elastic.Markdown/IO/MarkdownFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ private void ReadDocumentInstructions(MarkdownDocument document)
162162
}
163163

164164
var contents = document
165-
.Where(block => block is HeadingBlock { Level: >= 2 })
166-
.Cast<HeadingBlock>()
165+
.Descendants<HeadingBlock>()
166+
.Where(block => block is { Level: >= 2 })
167167
.Select(h => (h.GetData("header") as string, h.GetData("anchor") as string))
168168
.Select(h => new PageTocItem
169169
{

0 commit comments

Comments
 (0)