Refactor statement attributes copying logic in SUI core
This commit is contained in:
parent
dc8cfb66df
commit
e802599795
1 changed files with 10 additions and 0 deletions
|
|
@ -307,6 +307,16 @@ func (page *Page) parseProps(from *goquery.Selection, to *goquery.Selection, ext
|
|||
continue
|
||||
}
|
||||
|
||||
// Copy for and if statements
|
||||
if strings.HasPrefix(attr.Key, "s:for") || attr.Key == "s:if" || attr.Key == "s:else" || attr.Key == "s:elif" {
|
||||
to.SetAttr(attr.Key, attr.Val)
|
||||
transKey := fmt.Sprintf("s:trans-attr-%s", attr.Key)
|
||||
if trans, has := from.Attr(transKey); has {
|
||||
to.SetAttr(transKey, trans)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.HasPrefix(attr.Key, "s:") || attr.Key == "is" || attr.Key == "parsed" {
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue