diff --git a/index.html b/index.html index 8ff8756..12c7ee9 100644 --- a/index.html +++ b/index.html @@ -89,6 +89,8 @@ const addButton = document.querySelector('.add-form-button'); const commentsList = document.querySelector('.comments'); + let replyingToCommentId = null; + function getCurrentDateTime() { const now = new Date(); const day = String(now.getDate()).padStart(2, '0'); @@ -100,6 +102,16 @@ return `${day}.${month}.${year} ${hours}:${minutes}`; } + function escapeHtml(unsafe) { + if (!unsafe) return ''; + return unsafe + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>') + .replaceAll('"', '"') + .replaceAll("'", '''); + } + function renderComments() { let commentsHTML = ''; @@ -107,12 +119,12 @@ commentsHTML += `