diff --git a/lib/HtmlPhpExcel/HtmlPhpExcel.php b/lib/HtmlPhpExcel/HtmlPhpExcel.php index 285f500..e797a9c 100644 --- a/lib/HtmlPhpExcel/HtmlPhpExcel.php +++ b/lib/HtmlPhpExcel/HtmlPhpExcel.php @@ -227,6 +227,12 @@ private function createExcel(): void $excelWorksheet->getComment($excelCellIndex)->getText()->createText($cellComment); } + // Set Url + $cellLink = $cell->getAttribute('_excel-link'); + if ($cellLink = filter_var($cellLink, FILTER_SANITIZE_URL)) { + $excelWorksheet->getCell($excelCellIndex)->getHyperlink()->setUrl($cellLink); + } + // Merge cells $colspan = $cell->getAttribute('colspan'); $rowspan = $cell->getAttribute('rowspan');