Skip to content

@link tag breaks with URLs containing www #1509

@chharvey

Description

@chharvey

Bug: the @link tag does not process URLs with www in the domain.

This may solve bugs mentioned in #470.

Input code

/**
 * Me: {@link https://github.com/chharvey|@chharvey}
 *
 * Me: {@link https://www.github.com/chharvey|@chharvey}
 */

JSDoc configuration

{
  "sourceType": "module",
  "tags": {
    "allowUnknownTags": true,
    "dictionaries": ["jsdoc", "closure"]
  },
  "opts": {
    "destination": "./docs/api"
  },
  "plugins": [
    "plugins/markdown"
  ],
  "templates": {
    "cleverLinks": false,
    "monospaceLinks": false,
    "default": {
      "outputSourceFiles": true,
      "includeDate": false
    },
    "path": "ink-docstrap",
    "theme": "flatly",
    "navType": "vertical",
    "linenums": false,
    "dateFormat": "MMMM Do YYYY, h:mm:ss a"
  }
}

JSDoc debug output

<p>Me: <a href="https://github.com/chharvey">@chharvey</a></p>
<p>Me: <a href="https://%3Ca%20href=%22http://www.github.com/chharvey">@chharvey</a>"&gt;www.github.com/chharvey|@chharvey}</p>

Expected behavior

<p>Me: <a href="https://github.com/chharvey">@chharvey</a></p>
<p>Me: <a href="https://www.github.com/chharvey">@chharvey</a></p>

Your environment

Software Version
JSDoc 3.5.5
Node.js 8.9.1
npm 5.6.0
Operating system macOS 10.12.6 (Sierra)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions