fix InsertSpaceEvery24Chars

This commit is contained in:
Hepatica
2024-01-29 21:51:56 +01:00
parent 65ed89d05c
commit dead4e8c2a

View File

@@ -46,13 +46,16 @@ export default {
this.$emit("send", [formattedWord, this.username, this.icon]); this.$emit("send", [formattedWord, this.username, this.icon]);
this.msg = ""; this.msg = "";
}, },
InsertSpaceEvery24Chars(word) { InsertSpaceEvery24Chars(text) {
let result = ""; let result = "";
for (let i = 0; i < word.length; i += 22) { for (let i = 0; i < text.length; i++) {
result += word.substring(i, i + 22) + " "; if (i > 0 && i % 24 === 0) {
result += " ";
}
result += text[i];
} }
return result.trim(); return result;
}, },
}, },
}; };