-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make linkify links open in new tab/window #214
Conversation
I believe this behavior is more appropriate.
I think the appropriateness of this flag can vary wildly by application. Here's a random opinion piece on the topic: https://css-tricks.com/use-target_blank/. I think setting |
Hi @mentos1386, thanks a lot for your contribution! I think it fits the needs of xterm.js a lot, based on its main use cases. @vincentwoo is right though that the appropriateness of this flag can vary and if #198 was closed it would definitely help. What I would like to see here in order to move with merging is making this an option, by adding an additional argument to the At this moment it is important not to break the current behavior of xterm.js. |
You can now provide target argument if you want to modify target attribute on links. It defaults to `_self` to keep current behavior.
I changed it so that you can provide argument and it will set target to what you provide. Default behavior is that it doesn't change anything. |
@@ -67,6 +69,8 @@ | |||
throw new TypeError(message); | |||
} | |||
|
|||
typeof target === 'undefined' ? target = '' : target = 'target="' + target + '"'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please turn this in the following form to make it more human understandable?
if (typeof target === 'undefined') {
target = '';
} else {
target = 'target="' + target + '"';
}
EDIT: Please check for typos, I typed it really quickly to provide you the big picture 😅 !
Works great, thanks @mentos1386 🎉 ! |
I believe this behavior is more appropriate.