mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-09-20 07:47:46 -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) {
|
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);
|
||||||
|
|
Loading…
Reference in a new issue