fix(cli): use file URL for config import#3923
fix(cli): use file URL for config import#3923Nandann018-ux wants to merge 1 commit intomarkedjs:masterfrom
Conversation
|
@Nandann018-ux is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the CLI's ESM config loading mechanism. Previously, config files with special characters in their path, particularly '#', would fail to load because the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in the CLI where loading an ESM configuration file fails if the file path contains a hash (#) character. The fix replaces manual string concatenation for creating a file:/// URL with the pathToFileURL function, which correctly handles special characters and platform-specific path formats. A new unit test is included to verify that configuration files with a hash in the name can be imported successfully. The changes are correct and well-tested.
Marked version:
17.0.5
Markdown flavor: n/a
Description
file:///URL via string concatenation, which doesn’t escape#(and can be invalid on Windows paths). A config path containing#fails to load.--configshould load any valid file path.marked --config /path/with#hash.js -s "..."fails with module not found.pathToFileURL()for ESM config imports so special characters and Windows paths are encoded correctly.npm run build,npm run test:unitContributor
Committer