refactor(vocab): improve text normalization consistency in VocabService and VocabLessonView
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s

- Enhanced text normalization methods in both VocabService and VocabLessonView to include an additional trim operation, ensuring leading and trailing spaces are removed.
- This change improves the consistency and accuracy of text handling across the application, contributing to better user input processing.
This commit is contained in:
Torsten Schulz (local)
2026-04-01 15:09:15 +02:00
parent 7fee9e12d4
commit d38231b52c
2 changed files with 4 additions and 2 deletions

View File

@@ -346,7 +346,8 @@ export default class VocabService {
.trim()
.toLowerCase()
.replace(/[\p{P}]+/gu, ' ')
.replace(/\s+/g, ' ');
.replace(/\s+/g, ' ')
.trim();
}
_parseExercisePayload(value) {

View File

@@ -2705,7 +2705,8 @@ export default {
.trim()
.toLowerCase()
.replace(/[\p{P}]+/gu, ' ')
.replace(/\s+/g, ' ');
.replace(/\s+/g, ' ')
.trim();
},
normalizeVocab(s) {
return this.normalizeComparableText(s);