File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,11 @@ type regTplFunc struct {
9898
9999var regTplFuncs = []regTplFunc {
100100 // Regular expression for matching {{ TrackLink "http://link.com" }} in the template
101- // and substituting it with {{ Track "http://link.com" . }} (the dot context)
101+ // and substituting it with {{ TrackLink "http://link.com" . }} (the dot context)
102102 // before compilation. This is to make linking easier for users.
103103 {
104- regExp : regexp .MustCompile (`{{(\s+)? TrackLink( \s+)?(.+?)(\s+)? }}` ),
105- replace : `{{ TrackLink $3 . }}` ,
104+ regExp : regexp .MustCompile (`{{\s* TrackLink\s+"([^"]+)"\s* }}` ),
105+ replace : `{{ TrackLink "$1" . }}` ,
106106 },
107107
108108 // Convert the shorthand https://google.com@TrackLink to {{ TrackLink ... }}.
@@ -543,6 +543,7 @@ func (c *Campaign) CompileTemplate(f template.FuncMap) error {
543543 for _ , r := range regTplFuncs {
544544 body = r .regExp .ReplaceAllString (body , r .replace )
545545 }
546+
546547 baseTPL , err := template .New (BaseTpl ).Funcs (f ).Parse (body )
547548 if err != nil {
548549 return fmt .Errorf ("error compiling base template: %v" , err )
You can’t perform that action at this time.
0 commit comments