From ecb2815533eeef8524f46cafe5de0d89b1bc3551 Mon Sep 17 00:00:00 2001 From: Will Nilges Date: Mon, 15 Jan 2024 11:17:28 -0500 Subject: [PATCH] Remove Text field from StatusUpdate --- page.go | 1 - slack.go | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/page.go b/page.go index 2e8627e..721cc0e 100644 --- a/page.go +++ b/page.go @@ -8,7 +8,6 @@ import ( ) type StatusUpdate struct { - Text string HTML template.HTML SentBy string TimeStamp string diff --git a/slack.go b/slack.go index 9e42ce1..666df28 100644 --- a/slack.go +++ b/slack.go @@ -86,11 +86,10 @@ func (app *CSPSlack) BuildStatusPage() (err error) { } realName := msgUser.RealName var update StatusUpdate - update.Text = strings.Replace(message.Text, botID, "", -1) // Disgusting dependency chain to parse Mrkdwn to HTML - //linked := parseSlackMrkdwnLinks(update.Text) - md := mrkdwnToMarkdown(update.Text) + noBots := strings.Replace(message.Text, botID, "", -1) + md := mrkdwnToMarkdown(noBots) maybeUnsafeHTML := markdown.ToHTML([]byte(md), nil, nil) html := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML) update.HTML = template.HTML(html)