From e26a3333c4faaca2b3aed7efba0b6a13faeeb0e3 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Thu, 16 Apr 2026 15:23:00 +0200 Subject: [PATCH] fix(vocabLessonReview): improve input normalization by trimming punctuation - Enhanced the `normalize` method to trim trailing punctuation marks (.,!?;:) from input strings, ensuring cleaner and more consistent user input. - Added logic to replace multiple spaces with a single space, improving the overall formatting of normalized strings. --- frontend/src/views/social/VocabLessonReviewView.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/social/VocabLessonReviewView.vue b/frontend/src/views/social/VocabLessonReviewView.vue index 1fbd6b8..b9f57cc 100644 --- a/frontend/src/views/social/VocabLessonReviewView.vue +++ b/frontend/src/views/social/VocabLessonReviewView.vue @@ -111,7 +111,9 @@ export default { }, methods: { normalize(s) { - return String(s || '').trim().toLowerCase(); + const base = String(s || '').trim().toLowerCase(); + // Satzzeichen am Ende ignorieren (Punkt, Fragezeichen, Ausrufezeichen, Komma, Strichpunkt, Doppelpunkt) + return base.replace(/[.,!?;:]+$/g, '').replace(/\s+/g, ' '); }, getItemKey(item) { return `${String(item?.gloss || '').trim()}|${String(item?.target || '').trim()}`;