Skip to content

Commit

Permalink
Remove Text field from StatusUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Jan 15, 2024
1 parent e82ef77 commit ecb2815
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion page.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
)

type StatusUpdate struct {
Text string
HTML template.HTML
SentBy string
TimeStamp string
Expand Down
5 changes: 2 additions & 3 deletions slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ecb2815

Please sign in to comment.