|
|
@ -13,7 +13,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return sprintf( |
|
|
|
return sprintf( |
|
|
|
self::TAG_CODE, |
|
|
|
self::CODE, |
|
|
|
self::_escape( |
|
|
|
self::_escape( |
|
|
|
$value |
|
|
|
$value |
|
|
|
) |
|
|
|
) |
|
|
@ -26,7 +26,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return self::_wrap( |
|
|
|
return self::_wrap( |
|
|
|
self::TAG_H1, |
|
|
|
self::H1, |
|
|
|
$value, |
|
|
|
$value, |
|
|
|
$width |
|
|
|
$width |
|
|
|
); |
|
|
|
); |
|
|
@ -38,7 +38,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return self::_wrap( |
|
|
|
return self::_wrap( |
|
|
|
self::TAG_H2, |
|
|
|
self::H2, |
|
|
|
$value, |
|
|
|
$value, |
|
|
|
$width |
|
|
|
$width |
|
|
|
); |
|
|
|
); |
|
|
@ -50,7 +50,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return self::_wrap( |
|
|
|
return self::_wrap( |
|
|
|
self::TAG_H3, |
|
|
|
self::H3, |
|
|
|
$value, |
|
|
|
$value, |
|
|
|
$width |
|
|
|
$width |
|
|
|
); |
|
|
|
); |
|
|
@ -63,7 +63,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return sprintf( |
|
|
|
return sprintf( |
|
|
|
self::TAG_LINK, |
|
|
|
self::LINK, |
|
|
|
self::_escape( |
|
|
|
self::_escape( |
|
|
|
$href |
|
|
|
$href |
|
|
|
), |
|
|
|
), |
|
|
@ -82,7 +82,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return self::_wrap( |
|
|
|
return self::_wrap( |
|
|
|
self::TAG_LIST, |
|
|
|
self::LIST, |
|
|
|
sprintf( |
|
|
|
sprintf( |
|
|
|
'* %s', |
|
|
|
'* %s', |
|
|
|
$value |
|
|
|
$value |
|
|
@ -97,7 +97,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return self::_wrap( |
|
|
|
return self::_wrap( |
|
|
|
self::TAG_QUOTE, |
|
|
|
self::QUOTE, |
|
|
|
$value, |
|
|
|
$value, |
|
|
|
$width |
|
|
|
$width |
|
|
|
); |
|
|
|
); |
|
|
@ -109,7 +109,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
): string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return self::_wrap( |
|
|
|
return self::_wrap( |
|
|
|
self::TAG_TEXT, |
|
|
|
self::TEXT, |
|
|
|
$value, |
|
|
|
$value, |
|
|
|
$width |
|
|
|
$width |
|
|
|
); |
|
|
|
); |
|
|
@ -137,7 +137,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
|
|
|
|
|
|
|
|
// @TODO optimization wanted, wordwrap / set_line_wrap not solution |
|
|
|
// @TODO optimization wanted, wordwrap / set_line_wrap not solution |
|
|
|
protected static function _wrap( |
|
|
|
protected static function _wrap( |
|
|
|
string $tag, // const |
|
|
|
string $format, // const |
|
|
|
string $value, // unescaped |
|
|
|
string $value, // unescaped |
|
|
|
int $width = self::WRAP_WIDTH, |
|
|
|
int $width = self::WRAP_WIDTH, |
|
|
|
string $break = self::WRAP_BREAK, |
|
|
|
string $break = self::WRAP_BREAK, |
|
|
@ -158,7 +158,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
{ |
|
|
|
{ |
|
|
|
$label->set_markup( |
|
|
|
$label->set_markup( |
|
|
|
sprintf( |
|
|
|
sprintf( |
|
|
|
$tag, |
|
|
|
$format, |
|
|
|
self::_escape( |
|
|
|
self::_escape( |
|
|
|
implode( |
|
|
|
implode( |
|
|
|
' ' , $words[$line] |
|
|
|
' ' , $words[$line] |
|
|
@ -187,7 +187,7 @@ class Markup implements \Yggverse\Yoda\Interface\Model\Gtk\Pango\Markup |
|
|
|
$label->destroy(); |
|
|
|
$label->destroy(); |
|
|
|
|
|
|
|
|
|
|
|
return sprintf( |
|
|
|
return sprintf( |
|
|
|
$tag, |
|
|
|
$format, |
|
|
|
self::_escape( |
|
|
|
self::_escape( |
|
|
|
implode( |
|
|
|
implode( |
|
|
|
$break, |
|
|
|
$break, |
|
|
|