@syncfusion/ej2-richtexteditor 20.4.50 → 20.4.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12747,8 +12747,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
12747
12747
  }
12748
12748
  if (range.startContainer.nodeName === 'BR' && range.startOffset === 0 && range.startOffset === range.endOffset &&
12749
12749
  range.startContainer === range.endContainer) {
12750
- var currentIndex = Array.prototype.slice.call(range.startContainer.parentElement.children).indexOf(range.startContainer);
12751
- nodeSelection.setSelectionText(docElement, range.startContainer.parentElement, range.startContainer.parentElement, currentIndex + 1, currentIndex + 1);
12750
+ var currentIndex = Array.prototype.slice.call(range.startContainer.parentElement.childNodes).indexOf(range.startContainer);
12751
+ nodeSelection.setSelectionText(docElement, range.startContainer.parentElement, range.startContainer.parentElement, currentIndex, currentIndex);
12752
12752
  range = nodeSelection.getRange(docElement);
12753
12753
  }
12754
12754
  var isCursor = range.startOffset === range.endOffset && range.startOffset === 0 &&
@@ -18449,7 +18449,6 @@ var XhtmlValidation = /** @__PURE__ @class */ (function () {
18449
18449
  this.currentElement = this.parent.inputElement;
18450
18450
  }
18451
18451
  this.clean(this.currentElement);
18452
- this.AddRootElement();
18453
18452
  this.ImageTags();
18454
18453
  this.removeTags();
18455
18454
  this.RemoveUnsupported();
@@ -18496,16 +18495,6 @@ var XhtmlValidation = /** @__PURE__ @class */ (function () {
18496
18495
  }
18497
18496
  return currentValue;
18498
18497
  };
18499
- XhtmlValidation.prototype.AddRootElement = function () {
18500
- if ((this.currentElement.childNodes.length === 1 && this.currentElement.firstChild.nodeName !== 'DIV') ||
18501
- this.currentElement.childNodes.length > 1) {
18502
- var parentEle = this.parent.createElement('div');
18503
- while (this.currentElement.childNodes.length > 0) {
18504
- parentEle.appendChild(this.currentElement.childNodes[0]);
18505
- }
18506
- this.currentElement.appendChild(parentEle);
18507
- }
18508
- };
18509
18498
  XhtmlValidation.prototype.clean = function (node) {
18510
18499
  for (var n = 0; n < node.childNodes.length; n++) {
18511
18500
  var child = node.childNodes[n];
@@ -19930,7 +19919,7 @@ var PasteCleanup = /** @__PURE__ @class */ (function () {
19930
19919
  this.radioRender();
19931
19920
  /* eslint-disable */
19932
19921
  if (this.parent.element.offsetHeight < parseInt(this.dialogObj.height.split('px')[0], null)) {
19933
- this.parent.height = parseInt(this.dialogObj.height.split('px')[0], null) + 40;
19922
+ this.parent.setProperties({ height: parseInt(this.dialogObj.height.split('px')[0], null) + 40 });
19934
19923
  /* eslint-enable */
19935
19924
  isHeight = true;
19936
19925
  }
@@ -28724,7 +28713,7 @@ var EnterKeyAction = /** @__PURE__ @class */ (function () {
28724
28713
  isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
28725
28714
  }
28726
28715
  if (e.args.which === 13 && e.args.code === 'Enter') {
28727
- if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isTableEnter &&
28716
+ if (isNullOrUndefined(this.startNode.closest('LI,UL,OL')) && isNullOrUndefined(this.endNode.closest('LI,UL,OL')) && isTableEnter &&
28728
28717
  isNullOrUndefined(this.startNode.closest('PRE')) && isNullOrUndefined(this.endNode.closest('PRE'))) {
28729
28718
  var shiftKey_1 = e.args.shiftKey;
28730
28719
  var actionBeginArgs = {
@@ -29899,6 +29888,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
29899
29888
  }
29900
29889
  else {
29901
29890
  value = this.htmlEditorModule.sanitizeHelper(value);
29891
+ value = this.enableXhtml ? this.htmlEditorModule.xhtmlValidation.selfEncloseValidation(value) : value;
29902
29892
  }
29903
29893
  }
29904
29894
  return value;
@@ -31179,8 +31169,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
31179
31169
  }
31180
31170
  var getTextArea = this.element.querySelector('.e-rte-srctextarea');
31181
31171
  if (this.editorMode === 'HTML') {
31182
- value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>' ||
31183
- this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
31172
+ value = (this.inputElement.innerHTML === '<p><br></p>' || this.inputElement.innerHTML === '<div><br></div>'
31173
+ || this.inputElement.innerHTML === '<br>') ? null : this.enableHtmlEncode ?
31184
31174
  this.encode(decode(this.inputElement.innerHTML)) : this.inputElement.innerHTML;
31185
31175
  if (getTextArea && getTextArea.style.display === 'block') {
31186
31176
  value = getTextArea.value;