Skip to content
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

Recommend using target="_blank" instead of target="blank" (incorrect) #8278

Merged
merged 1 commit into from Apr 5, 2024

Conversation

ndbroadbent
Copy link
Contributor

Hello,

This is just a small change to some documentation. I noticed that there were some incorrect usages of target: :blank, which has also found it's way into some StackOverflow and ChatGPT answers.

You can find more information about this here: https://stackoverflow.com/questions/35703005/what-is-the-difference-between-target-blank-and-target-blank

blank targets an existing frame or window called "blank". A new window is created only if "blank" doesn't already exist.
_blank is a reserved name which targets a new, unnamed window.

So I just thought it might be worth opening a PR to show users the correct way to do it. Thanks!

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.10%. Comparing base (818aa1f) to head (42b0d7f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8278   +/-   ##
=======================================
  Coverage   99.10%   99.10%           
=======================================
  Files         140      140           
  Lines        4018     4018           
=======================================
  Hits         3982     3982           
  Misses         36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tagliala tagliala self-requested a review March 13, 2024 09:15
@@ -206,7 +206,7 @@ ActiveAdmin.setup do |config|
config.namespace :admin do |admin|
admin.build_menu :utility_navigation do |menu|
menu.add label: "ActiveAdmin.info", url: "https://www.activeadmin.info",
html_options: { target: :blank }
html_options: { target: :_blank }
Copy link
Contributor

Choose a reason for hiding this comment

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

@javierjulio isn't it better to have a string now that this symbol is changing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @tagliala, I've changed it to use strings instead of symbols

Copy link
Member

Choose a reason for hiding this comment

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

No, it won't matter because it will still covert that to a string. A symbol with a leading underscore is valid. I would have left the format as is but doesn't matter if its a string or not.

@tagliala tagliala self-requested a review March 20, 2024 14:52
Copy link
Contributor

@tagliala tagliala left a comment

Choose a reason for hiding this comment

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

Usage of quotes does not raise a RuboCop issue but it is not uniform with other quotes in this context

Can you switch to double quotes?

@tagliala
Copy link
Contributor

tagliala commented Mar 28, 2024

Usage of quotes does not raise a RuboCop issue but it is not uniform with other quotes in this context

@ndbroadbent can you please rebase and use double quotes instead of single quote?

@ndbroadbent
Copy link
Contributor Author

@tagliala I've rebased and updated the PR, thanks!

@mgrunberg mgrunberg merged commit 623cafc into activeadmin:master Apr 5, 2024
21 checks passed
mgrunberg pushed a commit that referenced this pull request Apr 30, 2024
… of target="blank" (incorrect) (#8278)

Use target="_blank" instead of target="blank" (incorrect)
mgrunberg added a commit that referenced this pull request Apr 30, 2024
…ncorrect) (#8311)

Backport to 3.0 stable branch Recommend using target="_blank" instead of target="blank" (incorrect) (#8278)

Use target="_blank" instead of target="blank" (incorrect)

Co-authored-by: Nathan Broadbent <git@ndbroadbent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants