Skip to content

Commit

Permalink
Merge pull request #701 from trheyi/main
Browse files Browse the repository at this point in the history
Refactor statement attributes copying logic in SUI core
  • Loading branch information
trheyi authored Jul 22, 2024
2 parents 4872ced + e802599 commit fc1442b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sui/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fc1442b

Please sign in to comment.