rust-lang / rust-lang/mdBook

Open Link in new tab

Open
#2,453 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-enhancement
Dominant language
Rust
Stars
22.2k
Forks
1.9k
PR merge metrics
PR metrics pending

Description

Problem

Currently all external https links are opened in the current browser window.
To open an external link in a new tap, one have to use the verbose html tag:
<a href="http://example.com/" target="_blank">Hello, world!</a>.

As mdbook is often used for documentation, it makes sense that links to external reference are opened in a new tab, as our readers still want to refer back to the documentation.

Proposed Solution

Add a custom option to open external links in new tab by default.

Notes

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing mdBook's external-link rendering and configuration handling. Add an opt-in configuration option for opening external HTTPS links in a new browser tab, then verify the generated HTML and confirm existing behavior remains unchanged when the option is not enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.