jodit 4.15.4 → 4.15.5
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 +25 -2
- package/es2015/jodit.min.js +5 -5
- 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 +5 -5
- 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 +25 -2
- package/es2021/jodit.min.js +5 -5
- 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 +3 -3
- package/es2021.en/jodit.js +25 -2
- package/es2021.en/jodit.min.js +11 -11
- 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 +30 -2
- 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/config.d.ts +9 -0
- package/esm/core/constants.js +1 -1
- package/esm/plugins/clean-html/clean-html.d.ts +9 -0
- package/esm/plugins/clean-html/clean-html.js +27 -0
- package/esm/plugins/clean-html/config.d.ts +9 -0
- package/esm/plugins/clean-html/config.js +1 -0
- package/package.json +1 -1
- package/types/config.d.ts +9 -0
- package/types/plugins/clean-html/clean-html.d.ts +9 -0
- package/types/plugins/clean-html/config.d.ts +9 -0
package/es2021.en/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.15.
|
|
4
|
+
* Version: v4.15.5
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1779,7 +1779,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1779
1779
|
* ```
|
|
1780
1780
|
* @packageDocumentation
|
|
1781
1781
|
* @module constants
|
|
1782
|
-
*/ const APP_VERSION = "4.15.
|
|
1782
|
+
*/ const APP_VERSION = "4.15.5";
|
|
1783
1783
|
// prettier-ignore
|
|
1784
1784
|
const ES = "es2021";
|
|
1785
1785
|
const IS_ES_MODERN = true;
|
|
@@ -28313,6 +28313,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
|
|
|
28313
28313
|
* `<p><br></p>` left after deleting all content) to an empty string —
|
|
28314
28314
|
* opt-in via `cleanHTML.collapseEmptyValueToEmptyString`. See #1149
|
|
28315
28315
|
*/ onAfterGetValueFromEditor(data) {
|
|
28316
|
+
this.__singleQuotesInFontFamily(data);
|
|
28316
28317
|
if (!this.j.o.cleanHTML.collapseEmptyValueToEmptyString) {
|
|
28317
28318
|
return;
|
|
28318
28319
|
}
|
|
@@ -28320,6 +28321,27 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_5__.Icon.set('class-span', (_class_s
|
|
|
28320
28321
|
data.value = '';
|
|
28321
28322
|
}
|
|
28322
28323
|
}
|
|
28324
|
+
/**
|
|
28325
|
+
* Rewrite double-quoted font names inside `style` attributes with single
|
|
28326
|
+
* quotes. The DOM always serialises them as `"…"`, and back ends
|
|
28327
|
+
* that HTML-decode the value before storing it then produce
|
|
28328
|
+
* `style="font-family: "Open Sans", …"` — broken markup. Single quotes
|
|
28329
|
+
* survive that round trip. Names that already contain an apostrophe are
|
|
28330
|
+
* left alone.
|
|
28331
|
+
*/ __singleQuotesInFontFamily(data) {
|
|
28332
|
+
if (!this.j.o.cleanHTML.singleQuotesInFontFamily || !data.value.includes('"')) {
|
|
28333
|
+
return;
|
|
28334
|
+
}
|
|
28335
|
+
data.value = data.value.replace(/\sstyle="([^"]*)"/gi, (attribute, css)=>{
|
|
28336
|
+
if (!css.includes('"') || !/font-family/i.test(css)) {
|
|
28337
|
+
return attribute;
|
|
28338
|
+
}
|
|
28339
|
+
const normalized = css.replace(// `"` itself ends with `;`, so the entity has to be
|
|
28340
|
+
// consumed as a unit or the declaration stops inside it.
|
|
28341
|
+
/font-family\s*:(?:"|[^;])*/gi, (declaration)=>declaration.includes("'") ? declaration : declaration.replace(/"/g, "'"));
|
|
28342
|
+
return attribute.replace(css, normalized);
|
|
28343
|
+
});
|
|
28344
|
+
}
|
|
28323
28345
|
onSafeHTML(sandBox) {
|
|
28324
28346
|
const sanitizer = this.j.o.cleanHTML.sanitizer;
|
|
28325
28347
|
if (sanitizer) {
|
|
@@ -28392,6 +28414,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.cleanHTML = {
|
|
|
28392
28414
|
removeEmptyElements: true,
|
|
28393
28415
|
fillEmptyParagraph: true,
|
|
28394
28416
|
collapseEmptyValueToEmptyString: false,
|
|
28417
|
+
singleQuotesInFontFamily: true,
|
|
28395
28418
|
replaceNBSP: true,
|
|
28396
28419
|
replaceOldTags: {
|
|
28397
28420
|
i: 'em',
|