TypeStrong / typedoc

Documentation generator for TypeScript projects.
https://typedoc.org
Apache License 2.0
7.71k stars 698 forks source link

Add ability to open markdown links in new tab #2679

Closed KDean-Dolphin closed 2 months ago

KDean-Dolphin commented 2 months ago

Search Terms

markdown link target _blank

Problem

The sourceLinkExternal option allows me to open links in a new tab when generating HTML. I would like to see a similar option for links in the markdown itself.

Suggested Solution

Markdown links are, as designed, processed by markdown-it. However, it's possible to add a target="_blank" to all links through the use of a custom renderer. This should be enabled through an option in the generator.

KDean-Dolphin commented 2 months ago

To add to this, now that I've converted all my links to use @link instead, this ability would be nice for any @link that is a URL.

Gerrit0 commented 2 months ago

TypeDoc renders @link to markdown before passing it to markdown-it, so the one option will pick up both cases