feat(编辑压缩): 规范导入编辑,优化资源压缩
build.yaml / build (push) Successful in 7m31s

This commit is contained in:
xiaoqidun committed 2026-10-12 00:43:15 +08:00
1 parent 225f60919b
commit 19dc79e8e3
23 files changed
+836 -289

No files matched your search

+6 -3
View File
@@ -95,7 +95,7 @@ func compactResourceProfiles(ctx context.Context, reader *Reader, parts map[stri
return fmt.Errorf("file not found: %s", name)
}
var err error
data, err = reader.readFile(name)
data, err = reader.readFileViewContext(ctx, name)
if err != nil {
return err
}
@@ -110,15 +110,18 @@ func compactResourceProfiles(ctx context.Context, reader *Reader, parts map[stri
continue
}
for _, node := range group.children {
if err := ctx.Err(); err != nil {
return err
}
location := indexes[name][editorResourceID(node.attr("ID"))]
if !node.matchesOFD("ColorSpace") || location == "" {
continue
}
fragment, err := editorXMLAttribute(data, node, "Profile", "/"+location)
patch, err := editorXMLAttributePatch(data, node, "Profile", "/"+location)
if err != nil {
return err
}
patches = append(patches, editorXMLPatch{start: node.start, end: node.end, data: fragment})
patches = append(patches, patch)
}
}
updates[name] = editorPatchXML(data, patches)