Bug Description
When formatting a JSDoc block containing an @see tag with a URL that includes query parameters, prettier-plugin-jsdoc incorrectly truncates the URL right before the = character. It strips out the rest of the query string and the hash fragment.
Input
/** @see https://github.com/lint-staged/lint-staged?tab=readme-ov-file#how-can-i-resolve-typescript-tsc-ignoring-tsconfigjson-when-lint-staged-runs-via-husky-hooks */
Output (Actual behavior)
/** @see https://github.com/lint-staged/lint-staged?tab */
Expected behavior
The URL should remain completely intact and not be truncated:
/** @see https://github.com/lint-staged/lint-staged?tab=readme-ov-file#how-can-i-resolve-typescript-tsc-ignoring-tsconfigjson-when-lint-staged-runs-via-husky-hooks */
Steps to Reproduce
- Create a JavaScript file with the provided input JSDoc comment.
- Run Prettier against the file with
prettier-plugin-jsdoc enabled.
- Observe that the URL in the
@see tag is destructively truncated after ?tab.
Environment
- Prettier Version: 3.8.3
prettier-plugin-jsdoc Version: 1.8.0
- Node.js Version: 26.1.0
- OS: Windows 11 x64
Bug Description
When formatting a JSDoc block containing an
@seetag with a URL that includes query parameters,prettier-plugin-jsdocincorrectly truncates the URL right before the=character. It strips out the rest of the query string and the hash fragment.Input
/** @see https://github.com/lint-staged/lint-staged?tab=readme-ov-file#how-can-i-resolve-typescript-tsc-ignoring-tsconfigjson-when-lint-staged-runs-via-husky-hooks */Output (Actual behavior)
/** @see https://github.com/lint-staged/lint-staged?tab */Expected behavior
The URL should remain completely intact and not be truncated:
/** @see https://github.com/lint-staged/lint-staged?tab=readme-ov-file#how-can-i-resolve-typescript-tsc-ignoring-tsconfigjson-when-lint-staged-runs-via-husky-hooks */Steps to Reproduce
prettier-plugin-jsdocenabled.@seetag is destructively truncated after?tab.Environment
prettier-plugin-jsdocVersion: 1.8.0