Skip to content

Commit

Permalink
Merge pull request #700 from trheyi/main
Browse files Browse the repository at this point in the history
fix missing trans-text attribute bug
  • Loading branch information
trheyi authored Jul 20, 2024
2 parents 67ffd4f + dc8cfb6 commit 4872ced
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sui/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,20 @@ func (page *Page) copyChildren(from *goquery.Selection, to *goquery.Selection) e
return nil
}
children.Find("slot").Remove()

// copy trans-node and trans-text properties
transNode, hasTransNode := from.Attr("s:trans-node")
transText, hasTransText := from.Attr("s:trans-text")
if hasTransNode || hasTransText {
parent := to.Find("children").Parent()
if hasTransNode {
parent.SetAttr("s:trans-node", transNode)
}
if hasTransText {
parent.SetAttr("s:trans-text", transText)
}
}

to.Find("children").ReplaceWithSelection(children)
return nil
}
Expand Down

0 comments on commit 4872ced

Please sign in to comment.