Skip to content

Add ability to open markdown links in new tab #2679

Closed
@KDean-Dolphin

Description

@KDean-Dolphin

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.

Activity

KDean-Dolphin

KDean-Dolphin commented on Aug 20, 2024

@KDean-Dolphin
Author

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.

added
help wantedContributions are especially encouraged
good first issueEasier issue for first time contributors
on Aug 21, 2024
Gerrit0

Gerrit0 commented on Aug 23, 2024

@Gerrit0
Collaborator

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

added this to the v0.26.7 milestone on Aug 23, 2024
added a commit that references this issue on Aug 23, 2024
66b2c53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasier issue for first time contributorshelp wantedContributions are especially encouraged

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @KDean-Dolphin@Gerrit0

        Issue actions

          Add ability to open markdown links in new tab · Issue #2679 · TypeStrong/typedoc