diff --git a/static/js/script.js b/static/js/script.js index 9541085..04cb3fd 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -119,7 +119,14 @@ document.addEventListener('DOMContentLoaded', function() { for (let i = 0; i < currentText.length; i++) { if (i < userInput.length) { if (userInput[i] === currentText[i]) { - highlightedText += `${currentText[i]}`; + // Für korrekt getippte Leerzeichen und Tabulatoren: sichtbar machen + if (currentText[i] === ' ') { + highlightedText += '·'; + } else if (currentText[i] === '\t') { + highlightedText += ''; + } else { + highlightedText += `${currentText[i]}`; + } } else { highlightedText += `${currentText[i]}`; }