From 849c82287659b4206ca1264b90b51fbe7768c024 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 26 May 2023 21:30:41 +0200 Subject: [PATCH] wait #5953 @1 --- app/Fluidbook/Compiler/Links.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Fluidbook/Compiler/Links.php b/app/Fluidbook/Compiler/Links.php index eda4c114f..b9524e944 100644 --- a/app/Fluidbook/Compiler/Links.php +++ b/app/Fluidbook/Compiler/Links.php @@ -323,7 +323,6 @@ trait Links // Keep this line because some properties of the link (like blend mode) are parsed with this function $c = $lta->getHTMLContainer(); - $css[] = $lta->getCSSContainer(); if (!isset($pages[$lta->page])) { $pages[$lta->page] = ['normal' => []]; @@ -360,7 +359,7 @@ trait Links $this->config->afterSearchTooltip = $link->tooltip; } - if (strpos($link->page, 'link_') === 0) { + if (self::isLinkPage($link->page)) { $linkPages[$link->page] = true; } @@ -387,9 +386,13 @@ trait Links } foreach ($allpages as $i) { - $this->config->set('links.' . $i, $this->_htmlLinkList($pages[$i] ?? [])); - $this->config->set('clinks.' . $i, $this->_htmlLinkList($cpages[$i] ?? [])); - $this->config->set('ctlinks.' . $i, $this->_htmlLinkList($ctpages[$i] ?? [])); + if (self::isLinkPage($i)) { + $this->config->set('links.' . $i, $this->_htmlLinkList(array_merge_recursive($pages[$i], $cpages[$i], $ctpages[$i]))); + } else { + $this->config->set('links.' . $i, $this->_htmlLinkList($pages[$i] ?? [])); + $this->config->set('clinks.' . $i, $this->_htmlLinkList($cpages[$i] ?? [])); + $this->config->set('ctlinks.' . $i, $this->_htmlLinkList($ctpages[$i] ?? [])); + } } if ($this->writeLinksData) { @@ -400,6 +403,11 @@ trait Links return $css; } + protected static function isLinkPage($page) + { + return str_starts_with($page, 'link_'); + } + protected function addLinkLinks($link, $links, $assetsDimensions, &$linksToAdd) { if (isset($link['inline']) && $link['inline'] === 'popup') { -- 2.39.5