修复文章中空格问题

This commit is contained in:
hansas
2025-09-13 10:48:10 +08:00
parent 315a552f3f
commit 294fa06088
2 changed files with 100 additions and 10 deletions

View File

@@ -61,10 +61,12 @@ export function useStartKeyboardEventListener() {
const currentWord = window.__CURRENT_WORD_INFO__;
// 如果当前单词包含空格,且下一个字符应该是空格,则将空格键视为输入
// 或者如果当前处于输入锁定状态(等待空格输入),也将空格键视为输入
if (currentWord &&
currentWord.word &&
currentWord.word.includes(' ') &&
currentWord.word[currentWord.input.length] === ' ') {
((currentWord.word &&
currentWord.word.includes(' ') &&
currentWord.word[currentWord.input.length] === ' ') ||
currentWord.inputLock === true)) {
e.preventDefault();
return emitter.emit(EventKey.onTyping, e);
}