From 8c80d537a542c4bdb74a9bec0e34d178c18b96b8 Mon Sep 17 00:00:00 2001 From: soufiane Date: Thu, 19 Feb 2026 17:06:42 +0100 Subject: [PATCH] wip #7913 @3:00 --- src/Links/AltTextImageLink.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Links/AltTextImageLink.php b/src/Links/AltTextImageLink.php index 13b3166..b094806 100644 --- a/src/Links/AltTextImageLink.php +++ b/src/Links/AltTextImageLink.php @@ -2,12 +2,27 @@ namespace Fluidbook\Tools\Links; -class AltTextImageLink extends NormalLink { +class AltTextImageLink extends Link { protected $role = ''; - public function getHTMLContent() + public function getAdditionnalContent() : string { + $res = parent::getAdditionnalContent(); + $res .= ' data-text="' . htmlspecialchars($this->to, ENT_QUOTES) . '" '; + return $res; + } + + public function getInnerContent() : string { + $class = $this->getClasses(); + $attrs = ''; + if (count($class)) { + $attrs .= ' class="' . implode(' ', $class) . '"'; + } + $attrs .= $this->getTooltipAttribute($this->to); + return 'getAdditionnalContent() . '>'; + } + + public function getHTMLContent() : string { - $attrs = $this->getTooltipAttribute($this->to); - return '
'.$this->to.'
'; + return '
'.$this->getInnerContent(); } } -- 2.39.5