mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-09-19 23:37:39 -07:00
Update server/model/status_page.js
This commit is contained in:
parent
e2d68408bf
commit
8951d4fdca
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue