From 45a74f0fc18deac3e100e8fc4f58997554a9f68d Mon Sep 17 00:00:00 2001 From: Pierre Lafievre Date: Tue, 9 Aug 2022 15:54:03 +0200 Subject: [PATCH] B #5914: fix double lines Signed-off-by: Pierre Lafievre (cherry picked from commit df3f44d68df2e129ee0e44efdc6b8ae6e2f78596) --- src/oca/go/src/goca/dynamic/dyntemplate.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/oca/go/src/goca/dynamic/dyntemplate.go b/src/oca/go/src/goca/dynamic/dyntemplate.go index 4070855008..f33c5f6843 100644 --- a/src/oca/go/src/goca/dynamic/dyntemplate.go +++ b/src/oca/go/src/goca/dynamic/dyntemplate.go @@ -81,8 +81,9 @@ func (p *Pair) String() string { } else { buf := bytes.NewBufferString(p.XMLName.Local) buf.WriteString("=\"") - buf.WriteString(strings.ReplaceAll(p.Value, `"`, `\"`)) - buf.WriteString(strings.ReplaceAll(p.Value, `\`, `\\`)) + newValue := strings.ReplaceAll(p.Value, `"`, `\"`) + newValue = strings.ReplaceAll(newValue, `\`, `\\`) + buf.WriteString(newValue) buf.WriteByte('"') return buf.String()