mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
add word wrap support for listing
This commit is contained in:
parent
0f223a347a
commit
8ef698c535
2 changed files with 9 additions and 4 deletions
|
|
@ -82,8 +82,11 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup
|
||||||
{
|
{
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'* %s', // @TODO
|
'* %s', // @TODO
|
||||||
htmlspecialchars(
|
self::_wrap(
|
||||||
$value
|
htmlspecialchars(
|
||||||
|
$value
|
||||||
|
),
|
||||||
|
$width
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -105,7 +108,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup
|
||||||
int $width = self::WRAP_WIDTH
|
int $width = self::WRAP_WIDTH
|
||||||
): string
|
): string
|
||||||
{
|
{
|
||||||
return self::_wrap( // @TODO slow
|
return self::_wrap(
|
||||||
htmlspecialchars(
|
htmlspecialchars(
|
||||||
$value
|
$value
|
||||||
),
|
),
|
||||||
|
|
@ -138,6 +141,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup
|
||||||
throw new Exception;
|
throw new Exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @TODO optimization wanted, wordwrap / set_line_wrap not solution
|
||||||
protected static function _wrap(
|
protected static function _wrap(
|
||||||
string $string,
|
string $string,
|
||||||
int $width,
|
int $width,
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,8 @@ class Gemtext extends \Yggverse\Yoda\Abstract\Model\Gtk\Pango\Markup
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$line[] = self::list(
|
$line[] = self::list(
|
||||||
$entity->getItem()
|
$entity->getItem(),
|
||||||
|
$width
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue