mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
fix return handler on activate-link event
This commit is contained in:
parent
aa3de2980c
commit
287f843283
3 changed files with 11 additions and 7 deletions
|
|
@ -58,7 +58,7 @@ abstract class Markup
|
|||
\GtkLabel $label,
|
||||
string $href
|
||||
) {
|
||||
$this->_onActivateLink(
|
||||
return $this->_onActivateLink(
|
||||
$label,
|
||||
$href
|
||||
);
|
||||
|
|
@ -69,7 +69,7 @@ abstract class Markup
|
|||
abstract protected function _onActivateLink(
|
||||
\GtkLabel $label,
|
||||
string $href
|
||||
);
|
||||
): bool;
|
||||
|
||||
abstract public function set(
|
||||
string $value
|
||||
|
|
|
|||
|
|
@ -236,7 +236,8 @@ class Gemtext extends Markup
|
|||
protected function _onActivateLink(
|
||||
\GtkLabel $label,
|
||||
string $href
|
||||
) {
|
||||
): bool
|
||||
{
|
||||
// Format URL
|
||||
$url = $this->_url(
|
||||
$href
|
||||
|
|
@ -253,7 +254,7 @@ class Gemtext extends Markup
|
|||
$this->content->page->update();
|
||||
|
||||
// Prevent propagation for supported protocols
|
||||
if (in_array(
|
||||
return in_array(
|
||||
parse_url(
|
||||
$url,
|
||||
PHP_URL_SCHEME
|
||||
|
|
@ -262,8 +263,8 @@ class Gemtext extends Markup
|
|||
'nex',
|
||||
'gemini',
|
||||
'file'
|
||||
])
|
||||
) return true;
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
private function _wrap(
|
||||
|
|
|
|||
|
|
@ -25,5 +25,8 @@ class Plain extends Markup
|
|||
protected function _onActivateLink(
|
||||
\GtkLabel $label,
|
||||
string $href
|
||||
) {}
|
||||
): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue