Qiskit / platypus

Qiskit Textbook (beta)
https://learn.qiskit.org
Apache License 2.0
143 stars 249 forks source link

Anchor links in the table of content shouldn't open in a new tab #442

Closed JRussellHuffman closed 3 years ago

JRussellHuffman commented 3 years ago

Steps to reproduce the problem

Pages that include an index at on the page, such as this one, will open those links in a new tab.

screenshot:

Screen Shot 2021-10-08 at 10 17 23 AM

What is the current behavior?

Link is opened in a new tab

What is the expected behavior?

Standard anchor link behavior where the user is jumped to lower on the page, within the same page.

IceKhan13 commented 3 years ago

From yesterday (21 Oct) test fest I found same issue on page pytorch-quantum-networks page. So, you are right, it's probably in other pages too.

techtolentino commented 3 years ago

Follow up:

After discussion with @vabarbosa - we've decided to make a pull-request in Mathigon to handle this.

JRussellHuffman commented 3 years ago

What solution did you end up going with? Is the PR for all same-page anchor links?

techtolentino commented 3 years ago

@JRussellHuffman

The PR is for the Studio build renderer.

We're hoping to merge a change that allows same-page anchor tags written in markdown, (e.g., [Example section](#example-section)) to render, without the target="_blank" attribute)

so, currently: [Example section](#example-section) will render <a href="#example-section" target="_blank">Example section</a>

and the PR is to allow [Example section](#example-section) to render <a href="#example-section">Example section</a> [Same domain link](https://same-domain.com/some-link) to render <a href="https://same-domain.com/some-link" target="_blank">Same domain link</a>

This way, same-page or same domain links will not open in new tabs.

Let's hope this 🤞

JRussellHuffman commented 3 years ago

Awesome. Sounds right to me!

vabarbosa commented 3 years ago

the pull-request in Mathigon has been merged.