File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ require (
2929 github.com/paulbellamy/ratecounter v0.2.0
3030 github.com/rhnvrm/simples3 v0.8.3
3131 github.com/spf13/pflag v1.0.5
32+ github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4
3233 github.com/yuin/goldmark v1.6.0
3334 github.com/zerodha/easyjson v1.0.0
3435 golang.org/x/mod v0.14.0
Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
132132github.com/valyala/bytebufferpool v1.0.0 /go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc =
133133github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo =
134134github.com/valyala/fasttemplate v1.2.2 /go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ =
135+ github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4 h1:0sw0nJM544SpsihWx1bkXdYLQDlzRflMgFJQ4Yih9ts =
136+ github.com/yosssi/gohtml v0.0.0-20201013000340-ee4748c638f4 /go.mod h1:+ccdNT0xMY1dtc5XBxumbYfOUhmduiGudqaDgD2rVRE =
135137github.com/yuin/goldmark v1.4.13 /go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY =
136138github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68 =
137139github.com/yuin/goldmark v1.6.0 /go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY =
Original file line number Diff line number Diff line change 66 "encoding/json"
77 "errors"
88 "fmt"
9+ "github.com/yosssi/gohtml"
910 "html/template"
1011 "net/textproto"
1112 "regexp"
@@ -569,6 +570,8 @@ func (c *Campaign) CompileTemplate(f template.FuncMap) error {
569570 body = c .Body
570571 }
571572
573+ body = gohtml .Format (body )
574+
572575 // Compile the campaign message.
573576 for _ , r := range regTplFuncs {
574577 body = r .regExp .ReplaceAllString (body , r .replace )
You can’t perform that action at this time.
0 commit comments