From 0baef8a140695754de9466a2581cca3f95987364 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 29 Feb 2024 09:47:03 +0100 Subject: [PATCH] Remove comments --- lib/page.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/page.php b/lib/page.php index f016ce3..a25e615 100644 --- a/lib/page.php +++ b/lib/page.php @@ -6,6 +6,10 @@ function renderDynamicPage($page_file): array return require $page_file; } +function removeHtmlComments($content = '') :string { + return preg_replace('//', '', $content); +} + function parsePageTag($input): array { // Define the pattern for the tag @@ -124,6 +128,8 @@ function renderPage($page_name = null, $site_name = null): array $page = str_replace("__TEMPLATE_PAGE_TITLE__", $page_title, $page); + $page = removeHtmlComments($page); + return [ "PageContent" => $page, "PageName" => $page_name,