Skip to content

Revise default target blank #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 25, 2025
Merged

Conversation

riccardoporreca
Copy link
Member

Revise the default opening of all links in a new tab (target="_blank") done in #50 (58105c3)

  • It breaks the search, as the dummy hash # link for the search is also opened in a new tab, where the search box does not even appear.
  • It also opens internal links (including section hashes) to the r-techguides in a new tab.
  • Also purge the unnecessary pandoc_args, introduced in the same commit.

Instead, all external links have an explicit target="_blank"

  • Done by batch regex replacement (\[[^\]]+\]\(http[^)]+\)) => $1{target="_blank"}

* It breaks the search, as the dummy hash `#` link for the search is also opened in a new tab, where the search box does not even appear.
* It would also open internal links (including section hashes) to the r-techguides in a new tab.
* Also purge the unnecessary `pandoc_args`.

This reverts part of what was done in commit 58105c3.
Batch regex replacement of
(\[[^\]]+\]\(http[^)]+\))
with
$1{target="_blank"}
@riccardoporreca riccardoporreca added bug Something isn't working maintenance labels Mar 25, 2025
@riccardoporreca
Copy link
Member Author

@RolandASc, You can verify the search is fully functional by serving the website locally via bookdown::serve_book()

Copy link
Member

@RolandASc RolandASc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@riccardoporreca riccardoporreca merged commit 61e1b61 into master Mar 25, 2025
4 checks passed
@riccardoporreca riccardoporreca deleted the feature/26-revise-target-blank branch March 25, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants