fix missing trans-text attribute bug
This commit is contained in:
parent
f32a677265
commit
dc8cfb66df
1 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue