Skip to content

Commit 5ea8cae

Browse files
authored
Merge pull request #1 from appvia/add_replace
Add replace
2 parents daed50c + e69dd01 commit 5ea8cae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ func render(w io.Writer, pkgs []*apiPackage, config generatorConfig) error {
680680
"isLocalType": isLocalType,
681681
"isOptionalMember": isOptionalMember,
682682
"constantsOfType": func(t *types.Type) []*types.Type { return constantsOfType(t, typePkgMap[t]) },
683+
"jsxEscape": func(s string) string {
684+
s = strings.ReplaceAll(s, "{{", "{ '{{' }")
685+
s = strings.ReplaceAll(s, "}}", "{ '}}' }")
686+
return s
687+
},
683688
}).ParseGlob(filepath.Join(*flTemplateDir, "*.tpl"))
684689
if err != nil {
685690
return errors.Wrap(err, "parse error")

0 commit comments

Comments
 (0)