1
0
Fork 0

the remove-extra-dashes script no longer removes dashes at the beginning or at the end of the words

This commit is contained in:
sspanak 2024-08-14 10:22:34 +03:00 committed by Dimo Karaivanov
parent 6086a08508
commit 7629b9914d

View file

@ -61,7 +61,7 @@ function removeCompoundWords(locale, words, lowerCaseWords, separator) {
const uniqueWords = new Set(); const uniqueWords = new Set();
words.forEach(w => { words.forEach(w => {
// simple words // simple words
if (!w.includes(separator)) { if (!w.includes(separator) || w.startsWith(separator) || w.endsWith(separator)) {
uniqueWords.add(w); uniqueWords.add(w);
return; return;
} }