jodit 4.18.1 → 4.18.2
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 +6 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +19 -8
- package/es2015/jodit.min.js +3 -3
- 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.js +3 -3
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +3 -3
- package/es2021/jodit.js +19 -8
- package/es2021/jodit.min.js +3 -3
- 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 +1 -1
- package/es2021.en/jodit.fat.min.js +24 -24
- package/es2021.en/jodit.js +19 -8
- package/es2021.en/jodit.min.js +3 -3
- 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 +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +21 -8
- package/es5/jodit.min.css +2 -2
- 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/plugins/clean-html/clean-html.d.ts +2 -1
- package/esm/plugins/clean-html/clean-html.js +24 -7
- package/package.json +1 -1
- package/types/plugins/clean-html/clean-html.d.ts +2 -1
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
export const APP_VERSION = "4.18.
|
|
6
|
+
export const APP_VERSION = "4.18.2";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -14,8 +14,9 @@ import "./config";
|
|
|
14
14
|
export declare class cleanHtml extends Plugin {
|
|
15
15
|
/** @override */
|
|
16
16
|
buttons: Plugin['buttons'];
|
|
17
|
+
constructor(jodit: IJodit);
|
|
17
18
|
/** @override */
|
|
18
|
-
protected afterInit(
|
|
19
|
+
protected afterInit(): void;
|
|
19
20
|
private get isEditMode();
|
|
20
21
|
/**
|
|
21
22
|
* Clean HTML code on every change
|
|
@@ -13,7 +13,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
|
-
import { hook, watch } from "../../core/decorators/index.js";
|
|
16
|
+
import { autobind, hook, watch } from "../../core/decorators/index.js";
|
|
17
17
|
import { Dom } from "../../core/dom/dom.js";
|
|
18
18
|
import { LazyWalker } from "../../core/dom/lazy-walker.js";
|
|
19
19
|
import { pluginSystem } from "../../core/global.js";
|
|
@@ -26,8 +26,8 @@ import { getHash, removeFormatForCollapsedSelection, removeFormatForSelection, v
|
|
|
26
26
|
*/
|
|
27
27
|
const TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
|
|
28
28
|
export class cleanHtml extends Plugin {
|
|
29
|
-
constructor() {
|
|
30
|
-
super(
|
|
29
|
+
constructor(jodit) {
|
|
30
|
+
super(jodit);
|
|
31
31
|
/** @override */
|
|
32
32
|
this.buttons = [
|
|
33
33
|
{
|
|
@@ -39,9 +39,22 @@ export class cleanHtml extends Plugin {
|
|
|
39
39
|
this.walker = new LazyWalker(this.j.async, {
|
|
40
40
|
timeout: this.j.o.cleanHTML.timeout
|
|
41
41
|
});
|
|
42
|
+
// `@watch` binds once the plugin is ready, which is after the initial
|
|
43
|
+
// value has already gone into the editor. The handlers that keep
|
|
44
|
+
// markup out of the live tree have to be there from the start, or
|
|
45
|
+
// event handlers in a textarea's content run before anything
|
|
46
|
+
// sanitises them.
|
|
47
|
+
jodit.e
|
|
48
|
+
.on('safeHTML', this.onSafeHTML)
|
|
49
|
+
.on('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue)
|
|
50
|
+
.on('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
|
|
42
51
|
}
|
|
43
52
|
/** @override */
|
|
44
|
-
afterInit(
|
|
53
|
+
afterInit() {
|
|
54
|
+
// The walker's own `:afterInit` watcher is bound on that very event,
|
|
55
|
+
// so without this the first pass waited for the first key or click
|
|
56
|
+
this.onChangeCleanHTML();
|
|
57
|
+
}
|
|
45
58
|
get isEditMode() {
|
|
46
59
|
return !(this.j.isInDestruct ||
|
|
47
60
|
!this.j.isEditorMode() ||
|
|
@@ -199,6 +212,10 @@ export class cleanHtml extends Plugin {
|
|
|
199
212
|
}
|
|
200
213
|
/** @override */
|
|
201
214
|
beforeDestruct() {
|
|
215
|
+
this.j.e
|
|
216
|
+
.off('safeHTML', this.onSafeHTML)
|
|
217
|
+
.off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue)
|
|
218
|
+
.off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
|
|
202
219
|
this.walker.destruct();
|
|
203
220
|
}
|
|
204
221
|
}
|
|
@@ -212,15 +229,15 @@ __decorate([
|
|
|
212
229
|
watch(':beforeCommand')
|
|
213
230
|
], cleanHtml.prototype, "beforeCommand", null);
|
|
214
231
|
__decorate([
|
|
215
|
-
|
|
232
|
+
autobind
|
|
216
233
|
], cleanHtml.prototype, "onAfterSetNativeEditorValue", null);
|
|
217
234
|
__decorate([
|
|
218
|
-
|
|
235
|
+
autobind
|
|
219
236
|
], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
|
|
220
237
|
__decorate([
|
|
221
238
|
watch(':afterGetValueFromEditor')
|
|
222
239
|
], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
|
|
223
240
|
__decorate([
|
|
224
|
-
|
|
241
|
+
autobind
|
|
225
242
|
], cleanHtml.prototype, "onSafeHTML", null);
|
|
226
243
|
pluginSystem.add('cleanHtml', cleanHtml);
|
package/package.json
CHANGED
|
@@ -14,8 +14,9 @@ import "./config";
|
|
|
14
14
|
export declare class cleanHtml extends Plugin {
|
|
15
15
|
/** @override */
|
|
16
16
|
buttons: Plugin['buttons'];
|
|
17
|
+
constructor(jodit: IJodit);
|
|
17
18
|
/** @override */
|
|
18
|
-
protected afterInit(
|
|
19
|
+
protected afterInit(): void;
|
|
19
20
|
private get isEditMode();
|
|
20
21
|
/**
|
|
21
22
|
* Clean HTML code on every change
|