Fix periods & add commas to LoremIpsum

This commit is contained in:
MrLetsplay 2023-10-28 10:57:57 +02:00
parent deda433535
commit 4c9675032c
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg

View File

@ -29,10 +29,14 @@ const LoremIpsum: Component = () => {
if (generator() < wordsSinceLastPeriod * wordsSinceLastPeriod * 0.002) {
str = str.trim() + '. ';
wordsSinceLastPeriod = 0;
} else if (generator() < 0.1) {
str = str.trim() + ', ';
}
}
str = str.trim() + '.';
str = str.trim();
if (str.endsWith(',')) str = str.substring(0, str.length - 1);
if (!str.endsWith('.')) str += '.';
setOutput(str);
}));