This commit is contained in:
Daniel 2024-08-05 21:21:24 +08:00
parent 8a82ce0feb
commit 30115901bd
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -113,6 +113,12 @@ func genTreeByJSON(node *ast.Node, tree *parse.Tree, idMap *map[string]bool, nee
node.Children = nil
}
if node.ID != node.IALAttr("id") {
//某些情况下会导致 ID 和属性 id 不相同 https://ld246.com/article/1722826829447
*needFix = true
node.SetIALAttr("id", node.ID)
}
switch node.Type {
case ast.NodeList:
if 1 > len(node.Children) {