Skip to content

Commit f229a65

Browse files
georgempQuietMisdreavus
authored andcommitted
fix: fix to issue #132 (implementation of child(through)
`func child(through path: TypedChildIndexPath) -> Markup?` uses the root document node's child count for comparison against the passed in path for valid reference to a child. Changed it to use the current iterated element. fix #132
1 parent 8ea3072 commit f229a65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Markdown/Base/Markup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ extension Markup {
265265
public func child(through path: TypedChildIndexPath) -> Markup? {
266266
var element: Markup = self
267267
for pathElement in path {
268-
guard pathElement.index <= raw.markup.childCount else {
268+
guard pathElement.index <= element.childCount else {
269269
return nil
270270
}
271271

0 commit comments

Comments
 (0)