From 78f70422e4b826ae6eff01984f7155495a4ef04f Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Fri, 9 Apr 2021 23:35:04 +0300 Subject: [PATCH] Issues-535: Fixed count for \r\n --- js/topcodereditor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/topcodereditor.js b/js/topcodereditor.js index f1ea4ce..ca0efed 100644 --- a/js/topcodereditor.js +++ b/js/topcodereditor.js @@ -542,6 +542,7 @@ var countOfRemainingChars = maxCommentLength; var text = cm.getValue(); if(text != null && text.length > 0) { + text = gdn.normalizeText(text); countOfRemainingChars = maxCommentLength - text.length; if(countOfRemainingChars < 0) { countOfRemainingChars = 0; @@ -553,6 +554,7 @@ var countOfRemainingChars = maxCommentLength; var text = cm.getValue(); if(text != null && text.length > 0) { + text = gdn.normalizeText(text); countOfRemainingChars = maxCommentLength - text.length; if(countOfRemainingChars < 0) { countOfRemainingChars = 0; @@ -575,6 +577,7 @@ var messageContainer = $(frm).find('.editor-statusbar .message'); var text = cm.getValue(); + text = gdn.normalizeText(text); if(text.length > 0 && text.length <= maxCommentLength) { $(editorContainer).removeClass('error'); $(messageContainer).text('');