Skip to content

Commit

Permalink
filter link tag on line construct
Browse files Browse the repository at this point in the history
  • Loading branch information
yggverse committed Apr 14, 2024
1 parent 675cdf3 commit cef1551
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Gemtext/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ class Link

public function __construct(string $line)
{
$this->_line = $line;
$this->_line = preg_replace(
'/^\s*=>(.*)/',
'$1',
trim(
$line
)
);
}

public function getAddress(): ?string
{
if (preg_match('/^=>\s*([^\s]+)/', trim($this->_line), $match))
if (preg_match('/^\s*([^\s]+)/', trim($this->_line), $match))
{
return trim(
$match[1]
Expand Down

0 comments on commit cef1551

Please sign in to comment.