Update template.go
We can specify "TemplateLeft" and "TemplateRight" but they did not work as these two changes are required.
Showing
1 changed file
with
2 additions
and
2 deletions
| ... | @@ -153,7 +153,7 @@ func getTplDeep(root, file, parent string, t *template.Template) (*template.Temp | ... | @@ -153,7 +153,7 @@ func getTplDeep(root, file, parent string, t *template.Template) (*template.Temp |
| 153 | if err != nil { | 153 | if err != nil { |
| 154 | return nil, [][]string{}, err | 154 | return nil, [][]string{}, err |
| 155 | } | 155 | } |
| 156 | reg := regexp.MustCompile("{{[ ]*template[ ]+\"([^\"]+)\"") | 156 | reg := regexp.MustCompile(TemplateLeft + "[ ]*template[ ]+\"([^\"]+)\"") |
| 157 | allsub := reg.FindAllStringSubmatch(string(data), -1) | 157 | allsub := reg.FindAllStringSubmatch(string(data), -1) |
| 158 | for _, m := range allsub { | 158 | for _, m := range allsub { |
| 159 | if len(m) == 2 { | 159 | if len(m) == 2 { |
| ... | @@ -216,7 +216,7 @@ func _getTemplate(t0 *template.Template, root string, submods [][]string, others | ... | @@ -216,7 +216,7 @@ func _getTemplate(t0 *template.Template, root string, submods [][]string, others |
| 216 | if err != nil { | 216 | if err != nil { |
| 217 | continue | 217 | continue |
| 218 | } | 218 | } |
| 219 | reg := regexp.MustCompile("{{[ ]*define[ ]+\"([^\"]+)\"") | 219 | reg := regexp.MustCompile(TemplateLeft + "[ ]*define[ ]+\"([^\"]+)\"") |
| 220 | allsub := reg.FindAllStringSubmatch(string(data), -1) | 220 | allsub := reg.FindAllStringSubmatch(string(data), -1) |
| 221 | for _, sub := range allsub { | 221 | for _, sub := range allsub { |
| 222 | if len(sub) == 2 && sub[1] == m[1] { | 222 | if len(sub) == 2 && sub[1] == m[1] { | ... | ... |
-
Please register or sign in to post a comment