Commit 3a1d112
Fix right-side navigation order when snippets are included (#1906)
* Initial plan
* Fix heading order issue when snippets are included
- Modified GetAnchors method to preserve line number from include directive
- Included snippet headings now appear at the correct position in TOC
- Changed from assigning line 0 to using actual include block line number
- This ensures right-side navigation respects document order
Co-authored-by: reakaleek <[email protected]>
* Final fix and test for snippet heading order issue
- Updated test to properly verify heading order in PageTableOfContent
- Verified fix works correctly with manual testing
- Snippet headings now appear in correct document order
Co-authored-by: reakaleek <[email protected]>
* Add comprehensive tests for include directive positioning
- Added test for include before headings (IncludeBeforeHeadingsOrderTests)
- Added test for include in middle of headings (IncludeInMiddleOfHeadingsOrderTests)
- Tests verify correct heading order for all include positions
- All 598 unit tests pass successfully
Co-authored-by: reakaleek <[email protected]>
* Add comprehensive tests for stepper components with includes
- Added IncludeWithStepperOrderTests: Tests stepper components combined with include directives
- Added StepperBeforeIncludeOrderTests: Tests stepper components before include directives
- Tests verify correct TOC ordering for stepper steps from both main document and included snippets
- All 604 unit tests pass successfully (6 new tests added)
Co-authored-by: reakaleek <[email protected]>
* Refactor tests to use numbered words as headings
- Changed all realistic headings to numbered words (One, Two, Three, etc.)
- Updated all expected TOC orders to follow sequential numbering
- Makes it easy to verify correct heading order in test output
- All 604 unit tests pass successfully
Co-authored-by: reakaleek <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: reakaleek <[email protected]>1 parent dc3f9c3 commit 3a1d112
File tree
2 files changed
+412
-4
lines changed- src/Elastic.Markdown/IO
- tests/Elastic.Markdown.Tests/FileInclusion
2 files changed
+412
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
262 | 266 | | |
263 | 267 | | |
264 | 268 | | |
| |||
308 | 312 | | |
309 | 313 | | |
310 | 314 | | |
311 | | - | |
| 315 | + | |
312 | 316 | | |
313 | 317 | | |
314 | 318 | | |
| |||
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
321 | | - | |
| 325 | + | |
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
| |||
0 commit comments