mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
f8263f798f
commit
85fbb77d63
4 files changed
+25
-2
No files matched your search
@@ -239,10 +239,19 @@ func editorXMLTextValue(data []byte, node *editorXML, before, after string) ([]b
|
||||
if before == after {
|
||||
return data[node.start:node.end], nil
|
||||
}
|
||||
textCode := node.matchesOFD("TextCode")
|
||||
if textCode {
|
||||
after = textCodeXMLValue(after)
|
||||
}
|
||||
var content bytes.Buffer
|
||||
if err := xml.EscapeText(&content, []byte(after)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if textCode && bytes.IndexByte(content.Bytes(), ' ') >= 0 {
|
||||
escaped := bytes.ReplaceAll(content.Bytes(), []byte(" "), []byte(" "))
|
||||
content.Reset()
|
||||
content.Write(escaped)
|
||||
}
|
||||
if node.open < node.close {
|
||||
inner := data[node.open:node.close]
|
||||
decoder := xml.NewDecoder(bytes.NewReader(inner))
|
||||
|
||||
Reference in new issue
Block a user