From 8951d4fdca52df282815a9f6f5675fca017bc0ba Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 31 Jul 2024 17:55:00 +0200 Subject: [PATCH] Update server/model/status_page.js --- server/model/status_page.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/model/status_page.js b/server/model/status_page.js index a88b2557d..e40b28f6f 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -48,13 +48,10 @@ class StatusPage extends BeanModel { static async renderHTML(indexHTML, statusPage) { const $ = cheerio.load(indexHTML); - let description155 = ""; - if (statusPage.description) { - description155 = marked(statusPage.description) - .replace(/(<([^>]+)>)/gi, "") - .trim(); - description155 = description155.substring(0, 155); - } + const description155 = marked(statusPage.description ?? "") + .replace(/<[^>]+>/gm, "") + .trim() + .substring(0, 155); $("title").text(statusPage.title); $("meta[name=description]").attr("content", description155);