summaryrefslogtreecommitdiffstats
path: root/bridge/helper/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/helper/helper.go')
-rw-r--r--bridge/helper/helper.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go
index 81789741..7edffb80 100644
--- a/bridge/helper/helper.go
+++ b/bridge/helper/helper.go
@@ -88,3 +88,13 @@ func HandleDownloadData(flog *log.Entry, msg *config.Message, name, comment, url
}
msg.Extra["file"] = append(msg.Extra["file"], config.FileInfo{Name: name, Data: data, URL: url, Comment: comment, Avatar: avatar})
}
+
+func RemoveEmptyNewLines(msg string) string {
+ lines := ""
+ for _, line := range strings.Split(msg, "\n") {
+ if line != "" {
+ lines += line + "\n"
+ }
+ }
+ return lines
+}