@syncfusion/ej2-richtexteditor 20.4.48 → 20.4.49
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.
- package/CHANGELOG.md +11 -1
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +71 -2
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +71 -2
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/editor-manager/plugin/ms-word-clean-up.js +29 -1
- package/src/editor-manager/plugin/selection-commands.js +42 -1
|
@@ -15742,6 +15742,7 @@ class SelectionCommands {
|
|
|
15742
15742
|
const startText = range.startContainer.nodeName === '#text' ?
|
|
15743
15743
|
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
15744
15744
|
range.startContainer.textContent;
|
|
15745
|
+
const nodeText = nodes[index].textContent;
|
|
15745
15746
|
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
15746
15747
|
&& range.endOffset === range.startContainer.length)) {
|
|
15747
15748
|
const nodeIndex = [];
|
|
@@ -15880,8 +15881,25 @@ class SelectionCommands {
|
|
|
15880
15881
|
parentElement = parentElement.parentElement;
|
|
15881
15882
|
liElement = parentElement;
|
|
15882
15883
|
}
|
|
15884
|
+
let num = index;
|
|
15885
|
+
let liChildContent = '';
|
|
15886
|
+
while (num >= 0 && !isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
|
|
15887
|
+
liChildContent = ' ' + nodes[num].textContent.trim() + liChildContent;
|
|
15888
|
+
num--;
|
|
15889
|
+
}
|
|
15890
|
+
let isNestedList = false;
|
|
15891
|
+
let nestedListCount = 0;
|
|
15892
|
+
let isNestedListItem = false;
|
|
15893
|
+
if (!isNullOrUndefined(liElement) && liElement.childNodes) {
|
|
15894
|
+
for (let num = 0; num < liElement.childNodes.length; num++) {
|
|
15895
|
+
if (liElement.childNodes[num].nodeName === ('OL' || 'UL')) {
|
|
15896
|
+
nestedListCount++;
|
|
15897
|
+
isNestedList = true;
|
|
15898
|
+
}
|
|
15899
|
+
}
|
|
15900
|
+
}
|
|
15883
15901
|
if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
15884
|
-
liElement.textContent.trim() ===
|
|
15902
|
+
liElement.textContent.split('\u200B').join('').trim() === liChildContent.split('\u200B').join('').trim()) {
|
|
15885
15903
|
if (format === 'fontsize') {
|
|
15886
15904
|
liElement.style.fontSize = value;
|
|
15887
15905
|
}
|
|
@@ -15890,6 +15908,29 @@ class SelectionCommands {
|
|
|
15890
15908
|
liElement.style.textDecoration = 'inherit';
|
|
15891
15909
|
}
|
|
15892
15910
|
}
|
|
15911
|
+
else if (!isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && isNestedList) {
|
|
15912
|
+
if (isNestedList && nestedListCount > 0) {
|
|
15913
|
+
for (let num = 0; num < liElement.childNodes.length; num++) {
|
|
15914
|
+
if (nodes[index].textContent === liElement.childNodes[num].textContent && nodes[index].textContent === nodeText && liElement.textContent.replace('/\u200B/g', '').trim().includes(liChildContent.split('\u200B').join('').trim())) {
|
|
15915
|
+
isNestedListItem = true;
|
|
15916
|
+
}
|
|
15917
|
+
}
|
|
15918
|
+
}
|
|
15919
|
+
if (isNestedListItem) {
|
|
15920
|
+
for (let num = 0; num < liElement.childNodes.length; num++) {
|
|
15921
|
+
if (liElement.childNodes[num].nodeName === ('OL' || 'UL')) {
|
|
15922
|
+
liElement.childNodes[num].style.fontSize = 'initial';
|
|
15923
|
+
}
|
|
15924
|
+
}
|
|
15925
|
+
if (format === 'fontsize') {
|
|
15926
|
+
liElement.style.fontSize = value;
|
|
15927
|
+
}
|
|
15928
|
+
else {
|
|
15929
|
+
liElement.style.color = value;
|
|
15930
|
+
liElement.style.textDecoration = 'inherit';
|
|
15931
|
+
}
|
|
15932
|
+
}
|
|
15933
|
+
}
|
|
15893
15934
|
}
|
|
15894
15935
|
}
|
|
15895
15936
|
return nodes[index];
|
|
@@ -16757,6 +16798,15 @@ class MsWordPaste {
|
|
|
16757
16798
|
if (pattern4.test(tempHTMLContent)) {
|
|
16758
16799
|
this.addTableBorderClass(elm);
|
|
16759
16800
|
}
|
|
16801
|
+
// Removing the margin for list items
|
|
16802
|
+
const liChildren = elm.querySelectorAll('li');
|
|
16803
|
+
if (liChildren.length > 0) {
|
|
16804
|
+
for (let i = 0; i < liChildren.length; i++) {
|
|
16805
|
+
if (!isNullOrUndefined(liChildren[i].style.marginLeft)) {
|
|
16806
|
+
liChildren[i].style.marginLeft = '';
|
|
16807
|
+
}
|
|
16808
|
+
}
|
|
16809
|
+
}
|
|
16760
16810
|
e.callBack(elm.innerHTML);
|
|
16761
16811
|
}
|
|
16762
16812
|
else {
|
|
@@ -17162,9 +17212,25 @@ class MsWordPaste {
|
|
|
17162
17212
|
this.getListContent(listNodes[i]);
|
|
17163
17213
|
let type;
|
|
17164
17214
|
let listStyleType;
|
|
17215
|
+
let startAttr;
|
|
17165
17216
|
if (!isNullOrUndefined(this.listContents[0])) {
|
|
17166
17217
|
type = this.listContents[0].trim().length > 1 ? 'ol' : 'ul';
|
|
17167
17218
|
listStyleType = this.getlistStyleType(this.listContents[0], type);
|
|
17219
|
+
if (type === 'ol' && listNodes[i - 1] === null) {
|
|
17220
|
+
const startString = this.listContents[0].split('.')[0];
|
|
17221
|
+
const listTypes = ['A', 'a', 'I', 'i', 'α', '1'];
|
|
17222
|
+
if (listTypes.indexOf(startString) === -1) {
|
|
17223
|
+
if (listStyleType === 'decimal') {
|
|
17224
|
+
// Bug in getlistStyleType() list style stype is returned as decimal for nested list with start attribute
|
|
17225
|
+
if (!isNaN(parseInt(startString))) {
|
|
17226
|
+
startAttr = parseInt(startString);
|
|
17227
|
+
}
|
|
17228
|
+
}
|
|
17229
|
+
else if (listStyleType === 'upper-alpha' || listStyleType === 'lower-alpha') {
|
|
17230
|
+
startAttr = parseInt(startString.toLowerCase()) - 96;
|
|
17231
|
+
}
|
|
17232
|
+
}
|
|
17233
|
+
}
|
|
17168
17234
|
const tempNode = [];
|
|
17169
17235
|
for (let j = 1; j < this.listContents.length; j++) {
|
|
17170
17236
|
tempNode.push(this.listContents[j]);
|
|
@@ -17181,7 +17247,7 @@ class MsWordPaste {
|
|
|
17181
17247
|
}
|
|
17182
17248
|
}
|
|
17183
17249
|
collection.push({ listType: type, content: tempNode, nestedLevel: level, class: currentClassName,
|
|
17184
|
-
listStyle: currentListStyle, listStyleTypeName: listStyleType });
|
|
17250
|
+
listStyle: currentListStyle, listStyleTypeName: listStyleType, start: startAttr });
|
|
17185
17251
|
}
|
|
17186
17252
|
}
|
|
17187
17253
|
stNode = listNodes.shift();
|
|
@@ -17345,6 +17411,9 @@ class MsWordPaste {
|
|
|
17345
17411
|
prevList.setAttribute('style', (!isNullOrUndefined(currentStyle) ? currentStyle : ''));
|
|
17346
17412
|
pLevel = collection[index].nestedLevel;
|
|
17347
17413
|
listCount++;
|
|
17414
|
+
if (!isNullOrUndefined(collection[index].start)) {
|
|
17415
|
+
temp.setAttribute('start', collection[index].start.toString());
|
|
17416
|
+
}
|
|
17348
17417
|
}
|
|
17349
17418
|
return root;
|
|
17350
17419
|
}
|