mirror of
https://github.com/YGGverse/gemini-php.git
synced 2025-01-27 15:24:36 +00:00
filter link tag on line construct
This commit is contained in:
parent
675cdf3ac4
commit
cef15510ea
@ -10,12 +10,18 @@ class Link
|
|||||||
|
|
||||||
public function __construct(string $line)
|
public function __construct(string $line)
|
||||||
{
|
{
|
||||||
$this->_line = $line;
|
$this->_line = preg_replace(
|
||||||
|
'/^\s*=>(.*)/',
|
||||||
|
'$1',
|
||||||
|
trim(
|
||||||
|
$line
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAddress(): ?string
|
public function getAddress(): ?string
|
||||||
{
|
{
|
||||||
if (preg_match('/^=>\s*([^\s]+)/', trim($this->_line), $match))
|
if (preg_match('/^\s*([^\s]+)/', trim($this->_line), $match))
|
||||||
{
|
{
|
||||||
return trim(
|
return trim(
|
||||||
$match[1]
|
$match[1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user