typedoc2md / typedoc-plugin-markdown

A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
https://typedoc-plugin-markdown.org
MIT License
689 stars 172 forks source link

Links to MDN are broken with `typedoc-plugin-mdn-links` since version `4.0.0` #614

Closed giladgd closed 1 month ago

giladgd commented 1 month ago

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

After upgrading to version 4.0.1, the links to MDN generated by typedoc-plugin-mdn-links include a space in the beginning, so they refer to an invalid local path instead of an external website.

Output on version 4.0.0-next.44:

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>

Output on version 4.0.1:

#### Returns

[`Promise ↗️`](%20https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise%20)\<`void`\>

By the way, it'd be great if there was a configuration to not add ↗️ to text of external links.

Thanks for making this awesome plugin :)

TypeDoc configuration

{
    "$schema": "https://typedoc.org/schema.json",
    "entryPoints": ["./src/index.ts"],
    "out": "./docs/api",
    "tsconfig": "./tsconfig.json",
    "readme": "./README.md",
    "excludeExternals": true,
    "excludeInternal": true,
    "excludePrivate": true,
    "githubPages": true,
    "hideGenerator": true,
    "jsDocCompatibility": true,
    "plugin": ["typedoc-plugin-markdown", "typedoc-vitepress-theme", "typedoc-plugin-mdn-links"],
    "hideBreadcrumbs": true,
    "hidePageHeader": true,
    "preserveAnchorCasing": true,
    "useCodeBlocks": true,
    "expandObjects": true,
    "expandParameters": true,
    "parametersFormat": "table",
    "propertiesFormat": "list",
    "enumMembersFormat": "table",
    "typeDeclarationFormat": "list",
    "sort": ["source-order"],
    "docsRoot": "./docs"
}

Expected behavior

I expect external links to be valid and start with http and not %20http and end with the content of the original link and not %20

tgreyuk commented 1 month ago

Thank you. Fixed in typedoc-plugin-markdown@4.0.2.