diff --git a/sui/core/data.go b/sui/core/data.go index f08997e11..6df33f67c 100644 --- a/sui/core/data.go +++ b/sui/core/data.go @@ -135,8 +135,8 @@ func (data Data) replaceNodeUse(re *regexp.Regexp, node *html.Node) bool { case html.ElementNode: for i := range node.Attr { - // Keepwords - if strings.HasPrefix(node.Attr[i].Key, "s:") || node.Attr[i].Key == "is" { + + if (strings.HasPrefix(node.Attr[i].Key, "s:") || node.Attr[i].Key == "is") && !allowUsePropAttrs[node.Attr[i].Key] { continue } diff --git a/sui/core/parser.go b/sui/core/parser.go index 795d31799..037403977 100644 --- a/sui/core/parser.go +++ b/sui/core/parser.go @@ -65,6 +65,13 @@ var keepWords = map[string]bool{ "s:bind": true, } +var allowUsePropAttrs = map[string]bool{ + "s:if": true, + "s:elif": true, + "s:for": true, + "s:click": true, +} + var keepAttrs = map[string]bool{ "s:ns": true, "s:cn": true,