feat(电子公文): 支持标引编辑与图元绑定
build.yaml / build (push) Successful in 50s

This commit is contained in:
xiaoqidun committed 2026-10-13 01:04:40 +08:00
1 parent e5685e5c7b
commit 261971cc41
9 files changed
+1072 -4

No files matched your search

+9
View File
@@ -252,6 +252,15 @@ func editorXMLTextValue(data []byte, node *editorXML, before, after string) ([]b
content.Reset()
content.Write(escaped)
}
return editorXMLDirectText(data, node, content.Bytes())
}
// editorXMLDirectText 替换直接文本,保留子节点、注释和处理指令
// 入参: data 原XML, node 目标节点, text 已转义的文本
// 返回: []byte 节点片段, error XML解析错误
func editorXMLDirectText(data []byte, node *editorXML, text []byte) ([]byte, error) {
var content bytes.Buffer
content.Write(text)
if node.open < node.close {
inner := data[node.open:node.close]
decoder := xml.NewDecoder(bytes.NewReader(inner))