Skip to content

Commit 09c8304

Browse files
committed
fix for issue 704, support trim suffix prop
1 parent b49da03 commit 09c8304

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ast/dynamic.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ type TrimNode struct {
178178
*ChildrenNode
179179
Name string
180180
Prefix string
181+
Suffix string
181182
PrefixOverrides []string
182183
SuffixOverrides []string
183184
}
@@ -202,6 +203,9 @@ func (n *TrimNode) Scan(start *xml.StartElement) error {
202203
if attr.Name.Local == "prefix" {
203204
n.Prefix = attr.Value
204205
}
206+
if attr.Name.Local == "suffix" {
207+
n.Suffix = attr.Value
208+
}
205209
if attr.Name.Local == "prefixOverrides" {
206210
n.PrefixOverrides = strings.Split(attr.Value, "|")
207211
}
@@ -233,6 +237,7 @@ func (n *TrimNode) GetStmt(ctx *Context) (string, error) {
233237
buff.WriteString(n.Prefix)
234238
buff.WriteString(" ")
235239
buff.WriteString(body)
240+
buff.WriteString(n.Suffix)
236241
return buff.String(), nil
237242
}
238243

0 commit comments

Comments
 (0)