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) {
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);