|
|
@ -111,6 +111,21 @@ class Body |
|
|
|
return $matches; |
|
|
|
return $matches; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getCode(): array |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$matches = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($this->_lines as $index => $line) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (preg_match('/^```(.*)/', trim($line), $match)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$matches[$index] = empty($match[1]) ? null : trim($match[1]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $matches; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function findLinks(string $protocol = 'gemini'): array |
|
|
|
public function findLinks(string $protocol = 'gemini'): array |
|
|
|
{ |
|
|
|
{ |
|
|
|
$matches = []; |
|
|
|
$matches = []; |
|
|
|