Repository navigation
Conversation
Refactors the path extraction logic in both index.ts and sidebars/index.ts to use segment-by-segment matching instead of string splitting. This fixes edge cases where docPath appears multiple times in outputDir or when paths have inconsistent leading/trailing slashes. Changes: - Normalize paths by removing leading ./ and leading/trailing slashes - Match docPath segments within outputDir segments sequentially - Clean up double slashes in the resulting infoBasePath Fixes PaloAltoNetworks#1305
Member
|
Thanks for digging into this, @trofim24, and sorry it sat so long. The sidebar part was fixed separately in #1368 (using a |
sserrata
added a commit
that referenced
this pull request
Oct 9, 2026
The infoPath calculation split outputDir on docPath as a substring, so an output dir such as "docs/test/docspace" produced "docs/test//<infoId>" and broke the API explorer's Authentication link. Share the startsWith helper from #1368 between the sidebar generator and infoPath, and skip empty segments so a docs-root output dir no longer yields "//". Supersedes #1306. Thanks to @trofim24 for the original report and fix. Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors the path extraction logic in both index.ts and sidebars/index.ts to use segment-by-segment matching instead of string splitting. This fixes edge cases where docPath appears multiple times in outputDir or when paths have inconsistent leading/trailing slashes.
Changes:
Fixes #1305
Description
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate)
Types of changes
Checklist