Commit 97df6e2
authored
This fixes a recent regression where `Markup.child(at:)` began returning
markup with incorrect metadata resulting in out-of-bounds errors.
The `indexInParent` value of a child is unrelated to the parent's
`indexInParent`. This was missed initially because tests were only
checking for children of the first item where `indexInParent` would
be 0. A new test has been added that asserts `Markup.child(at:)` returns
correct values for children of nested items as well.
1 parent 7a7c59d commit 97df6e2
File tree
2 files changed
+33
-1
lines changed- Sources/Markdown/Base
- Tests/MarkdownTests/Base
2 files changed
+33
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
351 | 370 | | |
352 | 371 | | |
353 | 372 | | |
| |||
361 | 380 | | |
362 | 381 | | |
363 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
364 | 396 | | |
365 | 397 | | |
366 | 398 | | |
| |||
0 commit comments