From 0bb68ae5543a6de15485a665143f75c0300a7607 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sat, 29 Nov 2025 13:22:13 +0800 Subject: [PATCH] [F] Space between English words --- src/lib/types.ts | 1 + src/lib/ui/player/IMEHelper.ts | 4 +++- src/lib/ui/player/Lyrics.svelte | 12 ++++++++++-- src/routes/song/[id]/play/+page.svelte | 8 ++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/lib/types.ts b/src/lib/types.ts index 740e45a..fcc77c1 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -88,6 +88,7 @@ export const typingSettingsDefault = { showRomaji: false, showRomajiOnError: true, hideRepeated: false, + ignoreEnglish: false, }; export type TypingSettings = typeof typingSettingsDefault; diff --git a/src/lib/ui/player/IMEHelper.ts b/src/lib/ui/player/IMEHelper.ts index e978c4e..94b6b99 100644 --- a/src/lib/ui/player/IMEHelper.ts +++ b/src/lib/ui/player/IMEHelper.ts @@ -49,4 +49,6 @@ export function dedupLines(lrc: LyricLine[], hide: boolean) { seen.add(key); return true; }); -} \ No newline at end of file +} + +export const isEnglish = (str: string | undefined) => str && /^[a-zA-Z\s.,'!?]+$/.test(str) \ No newline at end of file diff --git a/src/lib/ui/player/Lyrics.svelte b/src/lib/ui/player/Lyrics.svelte index debf27d..033abaa 100644 --- a/src/lib/ui/player/Lyrics.svelte +++ b/src/lib/ui/player/Lyrics.svelte @@ -1,7 +1,7 @@