Update server/model/status_page.js

This commit is contained in:
Frank Elsinga 2024-07-31 17:55:00 +02:00 committed by GitHub
parent e2d68408bf
commit 8951d4fdca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,13 +48,10 @@ class StatusPage extends BeanModel {
static async renderHTML(indexHTML, statusPage) { static async renderHTML(indexHTML, statusPage) {
const $ = cheerio.load(indexHTML); const $ = cheerio.load(indexHTML);
let description155 = ""; const description155 = marked(statusPage.description ?? "")
if (statusPage.description) { .replace(/<[^>]+>/gm, "")
description155 = marked(statusPage.description) .trim()
.replace(/(<([^>]+)>)/gi, "") .substring(0, 155);
.trim();
description155 = description155.substring(0, 155);
}
$("title").text(statusPage.title); $("title").text(statusPage.title);
$("meta[name=description]").attr("content", description155); $("meta[name=description]").attr("content", description155);