-
Notifications
You must be signed in to change notification settings - Fork 171
Add resolveRelativeUrl and resolveHtmlAssetLinks functions with tests #4316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implemented resolveRelativeUrl to handle markdown link resolution and added resolveHtmlAssetLinks to rewrite markdown page links. Updated loadMarketplacePage to utilize these functions and included comprehensive tests for both new functions in marketplaceData.test.ts.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f57902b051
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Updated resolveHtmlAssetLinks to include search and hash parameters in resolved links. Added extractSearchAndHash function to extract these components from URLs. Improved appendMarkdownExtensionIfNeeded to handle markdown extensions more effectively with a new getMarkdownExtension function.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
inlang-website | b4fc681 | Commit Preview URL Branch Preview URL |
Jan 20 2026, 10:14 PM |
…tension handling Updated the resolveRelativeUrl function to include an options parameter for controlling the appending of markdown extensions. Adjusted related functions and tests to utilize this new feature, ensuring consistent link resolution behavior across the application.
…nsions Updated the getMarkdownExtension function to first attempt URL parsing for baseUrl, ensuring it correctly identifies markdown extensions in the pathname. Added error handling to fallback on the original string check if URL parsing fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…on handling Refactored the resolveRelativeUrl function to improve markdown extension appending logic based on URL type. Introduced helper functions to determine when to append extensions and to handle URL parsing more effectively. Added a new test case to validate behavior with base URLs containing query strings.
Implemented resolveRelativeUrl to handle markdown link resolution and added resolveHtmlAssetLinks to rewrite markdown page links. Updated loadMarketplacePage to utilize these functions and included comprehensive tests for both new functions in marketplaceData.test.ts.
Note
Enhances marketplace markdown rendering with robust link handling.
resolveRelativeUrl(supports optional .md appending for raw GitHub bases) andresolveHtmlAssetLinksto rewritehref/srcin rendered HTMLbuildMarketplacePageLinkMapto convert known markdown page links to internal marketplace routes (preserving query/hash)loadMarketplacePagefor regular, README, and mirror pages; updatesresolveFrontmatterLinksto use new resolvermarketplaceData.test.ts; minor formatting fix inog-image.test.tsWritten by Cursor Bugbot for commit b4fc681. This will update automatically on new commits. Configure here.