Skip to content

Bug: URL in @see tag is incorrectly truncated at the equals sign = #263

@astrochemx

Description

@astrochemx

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

  1. Create a JavaScript file with the provided input JSDoc comment.
  2. Run Prettier against the file with prettier-plugin-jsdoc enabled.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions