mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
[PR #387] [MERGED] Add missing Descendants<T> api #977
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/387
Author: @MihaZupan
Created: 1/21/2020
Status: ✅ Merged
Merged: 1/21/2020
Merged by: @xoofx
Base:
master← Head:descendants-api📝 Commits (2)
e4e6406Add missing Descendants overloadfa2b157Improve some CharHelper methods📊 Changes
9 files changed (+220 additions, -56 deletions)
View changed files
📝
src/Markdig.Tests/TestDescendantsOrder.cs(+78 -10)📝
src/Markdig.Tests/TestParser.cs(+13 -1)📝
src/Markdig.Tests/TestPlayParser.cs(+1 -1)📝
src/Markdig.Tests/TestSourcePosition.cs(+8 -9)📝
src/Markdig/Extensions/Bootstrap/BootstrapExtension.cs(+2 -3)📝
src/Markdig/Extensions/Globalization/GlobalizationExtension.cs(+8 -11)📝
src/Markdig/Helpers/CharHelper.cs(+16 -11)📝
src/Markdig/Syntax/Inlines/ContainerInline.cs(+16 -2)📝
src/Markdig/Syntax/MarkdownObjectExtensions.cs(+78 -8)📄 Description
We were missing a few conveniance overloads (#63)
Since these can't coexist in C#, I added one
where T : MarkdownObjectthat then calls the appropriate internal overload for optimal traversal (has the added bonus of not allocating when it's obvious there can't be any descendants).Added tests for all the different overloads to make sure the traversal logic is correct.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.