feat(编辑能力): 完善资源扫描与裁剪保护
build.yaml / build (push) Successful in 50s

This commit is contained in:
xiaoqidun committed 2026-10-13 09:04:16 +08:00
1 parent 078c4e0736
commit a3594d1280
3 files changed
+16 -3

No files matched your search

+8
View File
@@ -144,6 +144,10 @@ func (s *editorReferenceScan) accept(token xml.Token) bool {
return false
}
if len(s.stack) == 0 {
if s.seen {
s.safe = false
return false
}
s.seen = true
if token.Name.Local == "Document" {
if s.refs.documents == nil {
@@ -216,6 +220,10 @@ func (s *editorReferenceScan) accept(token xml.Token) bool {
s.capture = true
}
case xml.CharData:
if len(s.stack) == 0 && len(bytes.Trim(token, " \t\r\n")) != 0 {
s.safe = false
return false
}
if s.capture {
s.text.Write(token)
}