mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 23:10:55 +00:00
Update template.go
We can specify "TemplateLeft" and "TemplateRight" but they did not work as these two changes are required.
This commit is contained in:
parent
ac6108a87d
commit
a5b5ae899c
@ -153,7 +153,7 @@ func getTplDeep(root, file, parent string, t *template.Template) (*template.Temp
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, [][]string{}, err
|
return nil, [][]string{}, err
|
||||||
}
|
}
|
||||||
reg := regexp.MustCompile("{{[ ]*template[ ]+\"([^\"]+)\"")
|
reg := regexp.MustCompile(TemplateLeft + "[ ]*template[ ]+\"([^\"]+)\"")
|
||||||
allsub := reg.FindAllStringSubmatch(string(data), -1)
|
allsub := reg.FindAllStringSubmatch(string(data), -1)
|
||||||
for _, m := range allsub {
|
for _, m := range allsub {
|
||||||
if len(m) == 2 {
|
if len(m) == 2 {
|
||||||
@ -216,7 +216,7 @@ func _getTemplate(t0 *template.Template, root string, submods [][]string, others
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
reg := regexp.MustCompile("{{[ ]*define[ ]+\"([^\"]+)\"")
|
reg := regexp.MustCompile(TemplateLeft + "[ ]*define[ ]+\"([^\"]+)\"")
|
||||||
allsub := reg.FindAllStringSubmatch(string(data), -1)
|
allsub := reg.FindAllStringSubmatch(string(data), -1)
|
||||||
for _, sub := range allsub {
|
for _, sub := range allsub {
|
||||||
if len(sub) == 2 && sub[1] == m[1] {
|
if len(sub) == 2 && sub[1] == m[1] {
|
||||||
|
Loading…
Reference in New Issue
Block a user