fix: 添加连字符扩展的 strip() 处理尾随空格

- 修复 _expand_hyphenated_text() 尾随空格问题
- trailing- → trailing (无尾随空格)
- -leading → leading (无前导空格)
- 所有边缘情况测试通过

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 07:56:19 +08:00
parent 421b3ada3b
commit 4cf9fc2e37
2 changed files with 57 additions and 2 deletions
+2 -2
View File
@@ -518,11 +518,11 @@ class Database:
text: 原始文本
Returns:
扩展后的文本(连字符替换为空格)
扩展后的文本(连字符替换为空格,并去除首尾空白
"""
if not text:
return ""
return text.replace('-', ' ')
return text.replace('-', ' ').strip()
async def delete_fts_content(self, path: str) -> None:
"""删除 FTS5 内容"""