diff --git a/js/maxlength.js b/js/maxlength.js
index 4fec4b5..6ff44dc 100644
--- a/js/maxlength.js
+++ b/js/maxlength.js
@@ -345,15 +345,22 @@
 
   // Sets the data into a ckeditor.
   ml.ckeditorSetData = function(e, data) {
-    // Calling setData() will place the cursor at the beginning, so we need to
-    // implement a callback to place it at the end, which is where the text is
-    // being truncated.
-    e.editor.setData(data, {callback: function() {
-      e.editor.focus();
-      var range = e.editor.createRange();
-      range.moveToElementEditablePosition(e.editor.editable(), true);
-      e.editor.getSelection().selectRanges([range]);
-    }});
+    // WYSIWYG can convert '\r\n' to '\n' and insert '\n' after some tags, this
+    // can result in circular changes as what is attempted to be inserted and
+    // what is actually inserted is different. We save the last inserted value
+    // on the editor to stop this issue.
+    if (e.editor.mlLastBeforeInsert !== e.editor.getData()) {
+      e.editor.mlLastBeforeInsert = e.editor.getData();
+      // Calling setData() will place the cursor at the beginning, so we need to
+      // implement a callback to place it at the end, which is where the text is
+      // being truncated.
+      e.editor.setData(data, {callback: function() {
+        e.editor.focus();
+        var range = e.editor.createRange();
+        range.moveToElementEditablePosition(e.editor.editable(), true);
+        e.editor.getSelection().selectRanges([range]);
+      }});
+    }
   }
 
 })(jQuery);
