define wrap storage

This commit is contained in:
yggverse 2024-07-28 15:45:21 +03:00
parent ba7a56ca7e
commit 3186ac6846
2 changed files with 16 additions and 10 deletions

View file

@ -315,15 +315,20 @@ class Gemtext extends Markup
}
private function _wrap(
string $value
string $source
): string
{
return wordwrap(
$value,
$this::WRAP,
PHP_EOL,
false
);
if ($wrap = $this->_wrap ? $this->_wrap : $this::WRAP)
{
return wordwrap(
$source,
$wrap,
PHP_EOL,
false
);
}
throw new Exception;
}
private function _url(