jodit 4.19.10 → 4.19.12
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 +150 -131
- package/es2015/jodit.css +33 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +10 -10
- package/es2015/jodit.js +781 -195
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +10 -10
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +10 -10
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +10 -10
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +33 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +15 -15
- package/es2021/jodit.js +780 -193
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +15 -15
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +33 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +22 -22
- package/es2021.en/jodit.js +780 -193
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +22 -22
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +34 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +827 -200
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.js +2 -2
- package/esm/core/helpers/checker/is-html-from-word.d.ts +4 -3
- package/esm/core/helpers/checker/is-html-from-word.js +94 -14
- package/esm/core/helpers/checker/is-html.d.ts +4 -0
- package/esm/core/helpers/checker/is-html.js +54 -2
- package/esm/core/helpers/html/apply-styles.js +20 -11
- package/esm/core/helpers/html/clean-from-word.js +2 -3
- package/esm/core/helpers/html/index.d.ts +1 -0
- package/esm/core/helpers/html/index.js +1 -0
- package/esm/core/helpers/html/tag-scan.d.ts +36 -0
- package/esm/core/helpers/html/tag-scan.js +257 -0
- package/esm/core/helpers/string/trim.d.ts +4 -0
- package/esm/core/helpers/string/trim.js +29 -10
- package/esm/core/selection/helpers/index.js +3 -2
- package/esm/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/esm/core/ui/button/tooltip/tooltip.js +14 -3
- package/esm/core/view/view-with-toolbar.js +6 -1
- package/esm/jodit.js +2 -1
- package/esm/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/esm/plugins/add-new-line/add-new-line.js +20 -3
- package/esm/plugins/delete/delete.d.ts +7 -0
- package/esm/plugins/delete/delete.js +38 -2
- package/esm/plugins/hr/hr.js +5 -0
- package/esm/plugins/iframe/iframe.js +59 -12
- package/esm/plugins/media/media.js +10 -9
- package/esm/plugins/paste/helpers.js +4 -2
- package/esm/plugins/resizer/resizer.js +6 -5
- package/esm/plugins/select-cells/select-cells.d.ts +1 -0
- package/esm/plugins/select-cells/select-cells.js +12 -18
- package/package.json +1 -1
- package/types/core/helpers/checker/is-html-from-word.d.ts +4 -3
- package/types/core/helpers/checker/is-html.d.ts +4 -0
- package/types/core/helpers/html/index.d.ts +1 -0
- package/types/core/helpers/html/tag-scan.d.ts +36 -0
- package/types/core/helpers/string/trim.d.ts +4 -0
- package/types/core/ui/button/tooltip/tooltip.d.ts +6 -0
- package/types/plugins/add-new-line/add-new-line.d.ts +5 -0
- package/types/plugins/delete/delete.d.ts +7 -0
- package/types/plugins/select-cells/select-cells.d.ts +1 -0
|
@@ -8,6 +8,7 @@ import { Dom } from "../../core/dom/dom.js";
|
|
|
8
8
|
import { pluginSystem } from "../../core/global.js";
|
|
9
9
|
import { error } from "../../core/helpers/index.js";
|
|
10
10
|
import { $$, attr, callPromise, css, defaultLanguage } from "../../core/helpers/index.js";
|
|
11
|
+
import { indexOfClosingTag, indexOfOpenTag, removeBetween } from "../../core/helpers/html/tag-scan.js";
|
|
11
12
|
import "./config.js";
|
|
12
13
|
/**
|
|
13
14
|
* Iframe plugin - use `iframe` instead of DIV in editor. It can be need when you want to attach custom styles in editor
|
|
@@ -84,20 +85,66 @@ export function iframe(editor) {
|
|
|
84
85
|
!editor.getReadOnly()) ||
|
|
85
86
|
null);
|
|
86
87
|
};
|
|
88
|
+
// The start of the whitespace run that ends at `to`
|
|
89
|
+
const skipBack = (text, to) => {
|
|
90
|
+
while (to > 0 && /\s/.test(text.charAt(to - 1))) {
|
|
91
|
+
to -= 1;
|
|
92
|
+
}
|
|
93
|
+
return to;
|
|
94
|
+
};
|
|
95
|
+
// The editor's own attributes on `<body>`: `min-height` and `contenteditable=true`
|
|
96
|
+
const cleanBodyTag = (tag) => {
|
|
97
|
+
tag = tag.replace(/min-height["'\s]*:[\s"']*[0-9]+(px|%)/i, '');
|
|
98
|
+
const skip = (from, chars) => {
|
|
99
|
+
while (chars.test(tag.charAt(from))) {
|
|
100
|
+
from += 1;
|
|
101
|
+
}
|
|
102
|
+
return from;
|
|
103
|
+
};
|
|
104
|
+
let index = tag.indexOf('contenteditable');
|
|
105
|
+
while (index !== -1) {
|
|
106
|
+
let to = skip(index + 'contenteditable'.length, /["'\s]/);
|
|
107
|
+
if (tag.charAt(to) === '=') {
|
|
108
|
+
to = skip(to + 1, /[\s"']/);
|
|
109
|
+
if (tag.startsWith('true', to)) {
|
|
110
|
+
to = skip(to + 4, /["']/);
|
|
111
|
+
let from = index;
|
|
112
|
+
if (/["']/.test(tag.charAt(from - 1))) {
|
|
113
|
+
from -= 1;
|
|
114
|
+
}
|
|
115
|
+
from = skipBack(tag, from);
|
|
116
|
+
return tag.slice(0, from) + tag.slice(to);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
index = tag.indexOf('contenteditable', index + 1);
|
|
120
|
+
}
|
|
121
|
+
return tag;
|
|
122
|
+
};
|
|
87
123
|
const clearMarkers = (html) => {
|
|
88
124
|
// The plugins' own styles, from `getContainer`, aren't part of the value
|
|
89
|
-
html = html
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
125
|
+
html = removeBetween(html, '<style', '>', '</style>', 'jodit-box');
|
|
126
|
+
const bodyStart = indexOfOpenTag(html, 'body');
|
|
127
|
+
let bodyEnd = -1;
|
|
128
|
+
for (let index = indexOfClosingTag(html, 'body', bodyStart + 1); index !== -1; index = indexOfClosingTag(html, 'body', index + 1)) {
|
|
129
|
+
bodyEnd = index;
|
|
130
|
+
}
|
|
131
|
+
if (bodyStart !== -1 && bodyEnd !== -1) {
|
|
132
|
+
const afterBody = bodyEnd + '</body>'.length;
|
|
133
|
+
const gt = html.indexOf('>', bodyStart);
|
|
134
|
+
let body = html.slice(bodyStart, afterBody);
|
|
135
|
+
if (gt !== -1 && gt < bodyEnd) {
|
|
136
|
+
body =
|
|
137
|
+
cleanBodyTag(html.slice(bodyStart, gt)) +
|
|
138
|
+
html.slice(gt, afterBody);
|
|
139
|
+
}
|
|
140
|
+
for (const tag of ['style', 'script', 'span']) {
|
|
141
|
+
body = removeBetween(body, '<' + tag, '>', '</' + tag + '>', 'jodit');
|
|
142
|
+
}
|
|
143
|
+
// remove markers: the spans outside the body are the editor's own
|
|
144
|
+
const stripSpans = (part) => removeBetween(removeBetween(part, '<span', '>', '</span>'), '<span', '>', '</span>');
|
|
145
|
+
html = (stripSpans(html.slice(0, bodyStart)) +
|
|
146
|
+
body +
|
|
147
|
+
stripSpans(html.slice(afterBody)))
|
|
101
148
|
.replace(/(class\s*=\s*)(['"])([^"']*)(jodit-wysiwyg|jodit)([^"']*\2)/g, '$1$2$3$5')
|
|
102
149
|
.replace(/(<[^<]+?)\sclass="[\s]*"/gim, '$1')
|
|
103
150
|
.replace(/(<[^<]+?)\sstyle="[\s;]*"/gim, '$1')
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as consts from "../../core/constants.js";
|
|
7
7
|
import { Dom } from "../../core/dom/dom.js";
|
|
8
8
|
import { getContainer, pluginSystem } from "../../core/global.js";
|
|
9
|
+
import { unwrapMarkedTags } from "../../core/helpers/html/tag-scan.js";
|
|
9
10
|
import { $$, attr, dataBind, getMediaWrapper, wrapMedia } from "../../core/helpers/utils/index.js";
|
|
10
11
|
import { css, cssInline } from "../../core/helpers/utils/css.js";
|
|
11
12
|
import "./config.js";
|
|
@@ -35,15 +36,18 @@ export function media(editor) {
|
|
|
35
36
|
});
|
|
36
37
|
attr(wrapper, 'style', attr(element, 'style'));
|
|
37
38
|
// The wrapper fits the media, whose size changes as its metadata loads
|
|
38
|
-
// and as it's resized.
|
|
39
|
+
// and as it's resized. It's inline, as the media is by default, so the
|
|
40
|
+
// line's text-align still places it, or a block when the media is one.
|
|
41
|
+
// A percentage width is of the line, so the wrapper is a block that
|
|
42
|
+
// takes the line, and the media in it follows the text-align it inherits
|
|
39
43
|
const fit = () => {
|
|
44
|
+
const ofLine = cssInline(media, 'width').endsWith('%');
|
|
40
45
|
css(wrapper, {
|
|
41
|
-
display:
|
|
46
|
+
display: !ofLine &&
|
|
47
|
+
/^inline/.test(css(media, 'display').toString())
|
|
42
48
|
? 'inline-block'
|
|
43
49
|
: 'block',
|
|
44
|
-
width:
|
|
45
|
-
? ''
|
|
46
|
-
: 'fit-content',
|
|
50
|
+
width: ofLine ? '' : 'fit-content',
|
|
47
51
|
height: ''
|
|
48
52
|
});
|
|
49
53
|
};
|
|
@@ -86,10 +90,7 @@ export function media(editor) {
|
|
|
86
90
|
if (mediaInFakeBlock || Object.keys(mediaWrappers).length) {
|
|
87
91
|
editor.e
|
|
88
92
|
.on('afterGetValueFromEditor', (data) => {
|
|
89
|
-
|
|
90
|
-
if (rxp.test(data.value)) {
|
|
91
|
-
data.value = data.value.replace(rxp, '$1');
|
|
92
|
-
}
|
|
93
|
+
data.value = unwrapMarkedTags(data.value, mediaFakeTag, `data-${keyFake}`);
|
|
93
94
|
})
|
|
94
95
|
.on('change afterInit afterSetMode changePlace', editor.async.debounce(() => {
|
|
95
96
|
if (!editor.isDestructed &&
|
|
@@ -7,13 +7,14 @@ import { TEXT_PLAIN } from "../../core/constants.js";
|
|
|
7
7
|
import { Dom } from "../../core/dom/dom.js";
|
|
8
8
|
import { toArray } from "../../core/helpers/array/to-array.js";
|
|
9
9
|
import { isArray, isNumber, isString, isVoid } from "../../core/helpers/checker/index.js";
|
|
10
|
+
import { removeTagsByPrefix } from "../../core/helpers/html/tag-scan.js";
|
|
10
11
|
import { Button } from "../../core/ui/button/button/button.js";
|
|
11
12
|
/**
|
|
12
13
|
* Remove special HTML comments
|
|
13
14
|
* @private
|
|
14
15
|
*/
|
|
15
16
|
function removeExtraFragments(html) {
|
|
16
|
-
html = html
|
|
17
|
+
html = removeTagsByPrefix(html, ['<meta']);
|
|
17
18
|
const start = html.search(/<!--StartFragment-->/i);
|
|
18
19
|
if (start !== -1) {
|
|
19
20
|
html = html.substring(start + 20);
|
|
@@ -32,7 +33,8 @@ function removeExtraFragments(html) {
|
|
|
32
33
|
* @private
|
|
33
34
|
*/
|
|
34
35
|
export function removeGoogleDocsWrapper(html) {
|
|
35
|
-
|
|
36
|
+
// A plain search: the wrapper check is left to the parsed document below
|
|
37
|
+
if (!/docs-internal-guid-/i.test(html)) {
|
|
36
38
|
return html;
|
|
37
39
|
}
|
|
38
40
|
// An inert document: images don't load and handlers don't run
|
|
@@ -19,6 +19,7 @@ import { autobind, watch } from "../../core/decorators/index.js";
|
|
|
19
19
|
import { Dom } from "../../core/dom/dom.js";
|
|
20
20
|
import { eventEmitter, getContainer, pluginSystem } from "../../core/global.js";
|
|
21
21
|
import { $$, attr, css, dataBind, getCaptionWrapper, getWrappedMedia, innerWidth, markOwner, offset } from "../../core/helpers/index.js";
|
|
22
|
+
import { unwrapMarkedTags } from "../../core/helpers/html/tag-scan.js";
|
|
22
23
|
import { cssInline } from "../../core/helpers/utils/css.js";
|
|
23
24
|
import { Plugin } from "../../core/plugin/plugin.js";
|
|
24
25
|
import { isMoved } from "../../core/selection/helpers/index.js";
|
|
@@ -157,10 +158,7 @@ export class resizer extends Plugin {
|
|
|
157
158
|
// move the caret, as table-keyboard-navigation's do
|
|
158
159
|
.on('keydown', this.onEditorKeyDown, { top: true })
|
|
159
160
|
.on('afterGetValueFromEditor.resizer', (data) => {
|
|
160
|
-
|
|
161
|
-
if (rgx.test(data.value)) {
|
|
162
|
-
data.value = data.value.replace(rgx, '$1');
|
|
163
|
-
}
|
|
161
|
+
data.value = unwrapMarkedTags(data.value, 'jodit', 'data-jodit_iframe_wrapper', inner => /<iframe/i.test(inner));
|
|
164
162
|
});
|
|
165
163
|
this.addEventListeners();
|
|
166
164
|
this.__onChangeEditor();
|
|
@@ -490,8 +488,11 @@ export class resizer extends Plugin {
|
|
|
490
488
|
// is nothing measurable at all, let the wrapper size itself.
|
|
491
489
|
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
492
490
|
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
491
|
+
// The wrapper takes the iframe's place in its line: inline, as an
|
|
492
|
+
// iframe is by default, so the line's text-align still places it,
|
|
493
|
+
// or a block when the iframe is one
|
|
493
494
|
css(wrapper, {
|
|
494
|
-
display:
|
|
495
|
+
display: /^inline/.test(css(element, 'display').toString())
|
|
495
496
|
? 'inline-block'
|
|
496
497
|
: 'block'
|
|
497
498
|
});
|
|
@@ -240,17 +240,14 @@ export class selectCells extends Plugin {
|
|
|
240
240
|
* Mouse move inside the table
|
|
241
241
|
*/
|
|
242
242
|
__onMove(table, e) {
|
|
243
|
-
var _a
|
|
243
|
+
var _a;
|
|
244
244
|
if (this.j.o.readonly && !this.j.isLocked) {
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
247
|
if (this.j.isLockedNotBy(key)) {
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
|
-
|
|
251
|
-
// host, so the lookup must start from the shadow root
|
|
252
|
-
const node = ((_a = this.j.o.shadowRoot) !== null && _a !== void 0 ? _a : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
253
|
-
const cell = node && Dom.closest(node, ['td', 'th'], table);
|
|
250
|
+
const cell = this.__cellUnder(e, table);
|
|
254
251
|
if (!cell || !this.__selectedCell) {
|
|
255
252
|
return;
|
|
256
253
|
}
|
|
@@ -276,7 +273,7 @@ export class selectCells extends Plugin {
|
|
|
276
273
|
}
|
|
277
274
|
const cellsCount = this.__tableModule.getAllSelectedCells().length;
|
|
278
275
|
if (cellsCount > 1) {
|
|
279
|
-
(
|
|
276
|
+
(_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
280
277
|
}
|
|
281
278
|
this.j.e.fire('hidePopup');
|
|
282
279
|
e.stopPropagation();
|
|
@@ -297,30 +294,27 @@ export class selectCells extends Plugin {
|
|
|
297
294
|
this.__isSelectionMode = false;
|
|
298
295
|
this.__selectedCell = null;
|
|
299
296
|
}
|
|
297
|
+
// The cell of this table under the pointer; over a table nested in a cell, the mouse is still in that cell
|
|
298
|
+
__cellUnder(e, table) {
|
|
299
|
+
var _a;
|
|
300
|
+
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
301
|
+
// host, so the lookup must start from the shadow root
|
|
302
|
+
const node = ((_a = this.j.o.shadowRoot) !== null && _a !== void 0 ? _a : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
303
|
+
return Dom.closest(node, elm => Dom.isCell(elm) && !Dom.closest(elm, 'table', table), table);
|
|
304
|
+
}
|
|
300
305
|
/**
|
|
301
306
|
* Stop a selection process
|
|
302
307
|
*/
|
|
303
308
|
__onStopSelection(table, e) {
|
|
304
|
-
var _a;
|
|
305
309
|
if (!this.__selectedCell) {
|
|
306
310
|
return;
|
|
307
311
|
}
|
|
308
312
|
this.__isSelectionMode = false;
|
|
309
313
|
this.j.unlock();
|
|
310
|
-
|
|
311
|
-
// host, so the lookup must start from the shadow root
|
|
312
|
-
const node = ((_a = this.j.o.shadowRoot) !== null && _a !== void 0 ? _a : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
313
|
-
if (!node) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
const cell = Dom.closest(node, ['td', 'th'], table);
|
|
314
|
+
const cell = this.__cellUnder(e, table);
|
|
317
315
|
if (!cell) {
|
|
318
316
|
return;
|
|
319
317
|
}
|
|
320
|
-
const ownTable = Dom.closest(cell, 'table', table);
|
|
321
|
-
if (ownTable && ownTable !== table) {
|
|
322
|
-
return; // Nested tables
|
|
323
|
-
}
|
|
324
318
|
this.__showCellsPopup(table, [cell, this.__selectedCell]);
|
|
325
319
|
this.__stopListening();
|
|
326
320
|
}
|
package/package.json
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* @module helpers/checker
|
|
8
|
-
*/
|
|
9
6
|
/**
|
|
10
7
|
* Detect if string is HTML from MS Word, Excel or LibreOffice/OpenOffice
|
|
8
|
+
*
|
|
9
|
+
* The clipboard text is attacker controlled, so every check walks the string
|
|
10
|
+
* once with `indexOf`: a regex with an unbounded group before a required
|
|
11
|
+
* literal was quadratic on a long run of `<meta` and froze the tab.
|
|
11
12
|
*/
|
|
12
13
|
export declare function isHtmlFromWord(data: string): boolean;
|
|
@@ -5,5 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Check if a string is html or not
|
|
8
|
+
*
|
|
9
|
+
* The pasted text is attacker controlled, so the check walks the string with
|
|
10
|
+
* `indexOf`: the former regex `<(\w+)[^>]*>(.*?)<\/\1>` was quadratic on a
|
|
11
|
+
* long run of `<a>` and froze the tab.
|
|
8
12
|
*/
|
|
9
13
|
export declare const isHTML: (str: unknown) => str is string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The first `</name>` at or after `from`, case-insensitive, or -1
|
|
8
|
+
*/
|
|
9
|
+
export declare function indexOfClosingTag(html: string, name: string, from: number): number;
|
|
10
|
+
/**
|
|
11
|
+
* Remove every tag that starts with one of the prefixes, up to its `>`:
|
|
12
|
+
* `removeTagsByPrefix(html, ['<meta', '<!--'])`
|
|
13
|
+
*/
|
|
14
|
+
export declare function removeTagsByPrefix(html: string, prefixes: string[]): string;
|
|
15
|
+
/**
|
|
16
|
+
* Strip the Word wrapper tags and then the comments, as the clean-up always did
|
|
17
|
+
*/
|
|
18
|
+
export declare function removeWordWrappers(html: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* The index of the first `<name>` or `<name …>` tag, or -1
|
|
21
|
+
*/
|
|
22
|
+
export declare function indexOfOpenTag(html: string, name: string): number;
|
|
23
|
+
/**
|
|
24
|
+
* Replace every `<name … marker …>inner</name>` with `inner`.
|
|
25
|
+
* `name` null takes any tag; `keep` can refuse an element by its inner HTML.
|
|
26
|
+
*/
|
|
27
|
+
export declare function unwrapMarkedTags(html: string, name: string | null, marker: string, keep?: (inner: string) => boolean): string;
|
|
28
|
+
/**
|
|
29
|
+
* Remove every `open … openEnd … close` block whose opener holds `marker` (any opener when it is ''):
|
|
30
|
+
* `removeBetween(html, '<style', '>', '</style>', 'jodit-box')`
|
|
31
|
+
*/
|
|
32
|
+
export declare function removeBetween(html: string, open: string, openEnd: string, close: string, marker?: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Remove every empty `<name … marker …></name>` element
|
|
35
|
+
*/
|
|
36
|
+
export declare function removeEmptyMarkedTags(html: string, name: string, marker: string): string;
|
|
@@ -13,3 +13,7 @@ export declare function trimChars(value: string, chars: string): string;
|
|
|
13
13
|
* Trim only invisible chars
|
|
14
14
|
*/
|
|
15
15
|
export declare function trimInv(value: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Without the invisible chars at the end
|
|
18
|
+
*/
|
|
19
|
+
export declare function trimInvEnd(value: string): string;
|
|
@@ -15,6 +15,12 @@ export declare class UITooltip extends UIElement {
|
|
|
15
15
|
className(): string;
|
|
16
16
|
protected render(): string;
|
|
17
17
|
constructor(view: IViewBased);
|
|
18
|
+
private get __isEnabled();
|
|
19
|
+
/**
|
|
20
|
+
* Show tooltips for the buttons in an element outside the editor's
|
|
21
|
+
* container, such as a toolbar placed by the `toolbar` option
|
|
22
|
+
*/
|
|
23
|
+
attach(container: HTMLElement): void;
|
|
18
24
|
private __attachedContainers;
|
|
19
25
|
private __onAttach;
|
|
20
26
|
private __listenClose;
|
|
@@ -29,6 +29,11 @@ export declare class addNewLine extends Plugin {
|
|
|
29
29
|
private __canGetFocus;
|
|
30
30
|
protected afterInit(editor: IJodit): void;
|
|
31
31
|
private __addEventListeners;
|
|
32
|
+
/**
|
|
33
|
+
* An empty line with a `<br>`, as Enter makes, so it keeps its height
|
|
34
|
+
* without clean-html's fillEmptyParagraph (#1807)
|
|
35
|
+
*/
|
|
36
|
+
private __newLine;
|
|
32
37
|
private __onClickLine;
|
|
33
38
|
/**
|
|
34
39
|
* A paragraph holding only an embed has no place for the caret, so the
|
|
@@ -20,6 +20,13 @@ export declare class deleteCommand extends Plugin {
|
|
|
20
20
|
*/
|
|
21
21
|
private __afterDeleteCommand;
|
|
22
22
|
private __onDeleteCommand;
|
|
23
|
+
/**
|
|
24
|
+
* Firefox selects cells whole from their row, as after a drag into or out
|
|
25
|
+
* of a table nested in a cell, and `deleteContents` would remove them. The
|
|
26
|
+
* edges move into the cells, so their content is cleared instead, as in
|
|
27
|
+
* Firefox's own delete
|
|
28
|
+
*/
|
|
29
|
+
private __moveEdgesIntoCells;
|
|
23
30
|
/**
|
|
24
31
|
* A selection that starts or ends in a table cell clears the selected part
|
|
25
32
|
* of each cell it covers and keeps the cells, as the browsers do.
|