mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-07 13:00:02 +00:00
fixed #10482 - duplicate browser tab opening when clicking a link with an IP in it
This commit is contained in:
parent
406e9e1c42
commit
e0c34ef7bc
@ -13,4 +13,12 @@ export abstract class LinkHandler {
|
||||
}
|
||||
|
||||
abstract handle (uri: string, tab?: BaseTerminalTabComponent<any>): void
|
||||
|
||||
private _fullMatchRegex: RegExp | null = null
|
||||
get fullMatchRegex (): RegExp {
|
||||
if (!this._fullMatchRegex) {
|
||||
this._fullMatchRegex = new RegExp(`^${this.regex.source}$`)
|
||||
}
|
||||
return this._fullMatchRegex
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ export class LinkHighlighterDecorator extends TerminalDecorator {
|
||||
|
||||
const openLink = async uri => {
|
||||
for (const handler of this.handlers) {
|
||||
if (!handler.regex.test(uri)) {
|
||||
if (!handler.fullMatchRegex.test(uri)) {
|
||||
continue
|
||||
}
|
||||
if (!await handler.verify(await handler.convert(uri, tab), tab)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user