|
|
@ -116,7 +116,7 @@ class Gemtext extends \Yggverse\Yoda\Abstract\Model\Gtk\Pango\Markup |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
$prefix = self::LINK_PREFIX_DEFAULT; |
|
|
|
$prefix = self::LINK_PREFIX_EXTERNAL; |
|
|
|
|
|
|
|
|
|
|
|
$line[] = self::link( |
|
|
|
$line[] = self::link( |
|
|
|
self::_url( |
|
|
|
self::_url( |
|
|
@ -208,34 +208,26 @@ class Gemtext extends \Yggverse\Yoda\Abstract\Model\Gtk\Pango\Markup |
|
|
|
private static function _url( |
|
|
|
private static function _url( |
|
|
|
string $link, |
|
|
|
string $link, |
|
|
|
string $base, |
|
|
|
string $base, |
|
|
|
string &$prefix = self::LINK_PREFIX_DEFAULT |
|
|
|
string &$prefix = self::LINK_PREFIX_EXTERNAL |
|
|
|
): ?string |
|
|
|
): ?string |
|
|
|
{ |
|
|
|
{ |
|
|
|
$address = new Address( |
|
|
|
$address = new Address( |
|
|
|
$link |
|
|
|
$link |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$request = new Address( |
|
|
|
|
|
|
|
$base |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if ($address->isRelative()) |
|
|
|
if ($address->isRelative()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$address->toAbsolute( |
|
|
|
$address->toAbsolute( |
|
|
|
new Address( |
|
|
|
$request |
|
|
|
$base |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch ($address->getScheme()) |
|
|
|
$prefix = $address->getScheme() == $request->getScheme() ? self::LINK_PREFIX_INTERNAL |
|
|
|
{ |
|
|
|
: self::LINK_PREFIX_EXTERNAL; |
|
|
|
case 'gemini': |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$prefix = self::LINK_PREFIX_GEMINI; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$prefix = self::LINK_PREFIX_DEFAULT; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $address->get(); |
|
|
|
return $address->get(); |
|
|
|
} |
|
|
|
} |
|
|
|