feat(空格处理): 规范空格转义,修复文字错位
build.yaml / build (push) Successful in 48s

This commit is contained in:
xiaoqidun committed 2026-10-12 23:39:27 +08:00
1 parent f8263f798f
commit 85fbb77d63
4 files changed
+25 -2

No files matched your search

+13
View File
@@ -278,6 +278,19 @@ func textDelta(deltas []float64, index int) (float64, bool) {
return deltas[len(deltas)-1], true
}
// textCodeXMLValue 将空格转义还原为字符,供XML写出层统一编码
// 入参: value OFD文字编码
// 返回: string 待写出的文字编码
func textCodeXMLValue(value string) string {
if !strings.Contains(value, `\0020`) {
return value
}
if strings.ContainsAny(value, "\r\n") {
return escapeOFDText(string(textCodeRunes(value)))
}
return strings.ReplaceAll(value, `\0020`, " ")
}
// textCodeRunes 获取文本编码字符
// 入参: value 文本编码内容
// 返回: []rune 文本字符