feat(参照标准): 规范资源处理,完善版本编辑
build.yaml / build (push) Successful in 42s

This commit is contained in:
xiaoqidun committed 2026-10-10 20:43:06 +08:00
1 parent 53769b65ab
commit 492adccb81
35 files changed
+1182 -239

No files matched your search

+3 -3
View File
@@ -73,7 +73,7 @@ func (e *Editor) AddAttachment(name string, data []byte) (string, error) {
return "", err
}
entry = bytes.TrimPrefix(entry, []byte(xml.Header))
docName := cleanPackagePath(base.reader.OFD.DocBody[base.reader.documentIndex].DocRoot)
docName := base.reader.documentRoot
docData, err := base.reader.readFile(docName)
if err != nil {
return "", err
@@ -220,7 +220,7 @@ func (e *Editor) editAttachment(id string, change func([]byte, *editorXML, map[s
if base == nil {
return fmt.Errorf("attachment not found: %s", id)
}
name := cleanPackagePath(base.reader.OFD.DocBody[base.reader.documentIndex].DocRoot)
name := base.reader.documentRoot
external := strings.TrimSpace(base.document.Attachments.Path) != ""
if external {
name = base.reader.ResPath(base.document.Attachments.Path)
@@ -277,7 +277,7 @@ func (e *Editor) editAttachment(id string, change func([]byte, *editorXML, map[s
if retired == nil {
retired = make(map[string]bool)
}
retired[strings.ToLower(cleanPackagePath(base.reader.ResPath(location)))] = true
retired[editorResourceLocation(name, "", location)] = true
e.source.retiredAttachments = retired
}
}