mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-31 12:40:00 +00:00
Update src/PhpSpreadsheet/Reader/Xlsx/Hyperlinks.php
Fix wrong white space from copy/paste from editor. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -46,18 +46,17 @@ class Hyperlinks
|
||||
$cell = $worksheet->getCell($cellReference);
|
||||
|
||||
$hyperlinkUrl = '';
|
||||
if (isset($linkRel['id'])) {
|
||||
$hyperlinkUrl = $this->hyperlinks[(string) $linkRel['id']] ?? '';
|
||||
}
|
||||
if (isset($attributes['location'])) {
|
||||
if ($hyperlinkUrl === '') {
|
||||
$hyperlinkUrl = 'sheet://' . (string) $attributes['location'];
|
||||
} else {
|
||||
$hyperlinkUrl .= '#' . (string) $attributes['location'];
|
||||
}
|
||||
}
|
||||
$cell->getHyperlink()->setUrl($hyperlinkUrl);
|
||||
|
||||
if (isset($linkRel['id'])) {
|
||||
$hyperlinkUrl = $this->hyperlinks[(string) $linkRel['id']] ?? '';
|
||||
}
|
||||
if (isset($attributes['location'])) {
|
||||
if ($hyperlinkUrl === '') {
|
||||
$hyperlinkUrl = 'sheet://' . (string) $attributes['location'];
|
||||
} else {
|
||||
$hyperlinkUrl .= '#' . (string) $attributes['location'];
|
||||
}
|
||||
}
|
||||
$cell->getHyperlink()->setUrl($hyperlinkUrl);
|
||||
// Tooltip
|
||||
if (isset($attributes['tooltip'])) {
|
||||
$cell->getHyperlink()->setTooltip((string) $attributes['tooltip']);
|
||||
|
||||
Reference in New Issue
Block a user