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.
Files changed (59) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +25 -2
  5. package/es2015/jodit.min.js +5 -5
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +3 -3
  13. package/es2018/jodit.min.js +5 -5
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +3 -3
  18. package/es2021/jodit.js +25 -2
  19. package/es2021/jodit.min.js +5 -5
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +3 -3
  28. package/es2021.en/jodit.js +25 -2
  29. package/es2021.en/jodit.min.js +11 -11
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +30 -2
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/config.d.ts +9 -0
  51. package/esm/core/constants.js +1 -1
  52. package/esm/plugins/clean-html/clean-html.d.ts +9 -0
  53. package/esm/plugins/clean-html/clean-html.js +27 -0
  54. package/esm/plugins/clean-html/config.d.ts +9 -0
  55. package/esm/plugins/clean-html/config.js +1 -0
  56. package/package.json +1 -1
  57. package/types/config.d.ts +9 -0
  58. package/types/plugins/clean-html/clean-html.d.ts +9 -0
  59. package/types/plugins/clean-html/config.d.ts +9 -0
package/es5/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
4
+ * Version: v4.15.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2107,7 +2107,7 @@ __webpack_require__.r(__webpack_exports__);
2107
2107
  * @packageDocumentation
2108
2108
  * @module constants
2109
2109
  */
2110
- var APP_VERSION = "4.15.4";
2110
+ var APP_VERSION = "4.15.5";
2111
2111
  // prettier-ignore
2112
2112
  var ES = "es5";
2113
2113
  var IS_ES_MODERN = false;
@@ -34197,6 +34197,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34197
34197
  * `<p><br></p>` left after deleting all content) to an empty string —
34198
34198
  * opt-in via `cleanHTML.collapseEmptyValueToEmptyString`. See #1149
34199
34199
  */ function onAfterGetValueFromEditor(data) {
34200
+ this.__singleQuotesInFontFamily(data);
34200
34201
  if (!this.j.o.cleanHTML.collapseEmptyValueToEmptyString) {
34201
34202
  return;
34202
34203
  }
@@ -34205,6 +34206,32 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34205
34206
  }
34206
34207
  }
34207
34208
  },
34209
+ {
34210
+ key: "__singleQuotesInFontFamily",
34211
+ value: /**
34212
+ * Rewrite double-quoted font names inside `style` attributes with single
34213
+ * quotes. The DOM always serialises them as `&quot;…&quot;`, and back ends
34214
+ * that HTML-decode the value before storing it then produce
34215
+ * `style="font-family: "Open Sans", …"` — broken markup. Single quotes
34216
+ * survive that round trip. Names that already contain an apostrophe are
34217
+ * left alone.
34218
+ */ function __singleQuotesInFontFamily(data) {
34219
+ if (!this.j.o.cleanHTML.singleQuotesInFontFamily || !data.value.includes('&quot;')) {
34220
+ return;
34221
+ }
34222
+ data.value = data.value.replace(/\sstyle="([^"]*)"/gi, function(attribute, css) {
34223
+ if (!css.includes('&quot;') || !/font-family/i.test(css)) {
34224
+ return attribute;
34225
+ }
34226
+ var normalized = css.replace(// `&quot;` itself ends with `;`, so the entity has to be
34227
+ // consumed as a unit or the declaration stops inside it.
34228
+ /font-family\s*:(?:&quot;|[^;])*/gi, function(declaration) {
34229
+ return declaration.includes("'") ? declaration : declaration.replace(/&quot;/g, "'");
34230
+ });
34231
+ return attribute.replace(css, normalized);
34232
+ });
34233
+ }
34234
+ },
34208
34235
  {
34209
34236
  key: "onSafeHTML",
34210
34237
  value: function onSafeHTML(sandBox) {
@@ -34275,6 +34302,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.cleanHTML = {
34275
34302
  removeEmptyElements: true,
34276
34303
  fillEmptyParagraph: true,
34277
34304
  collapseEmptyValueToEmptyString: false,
34305
+ singleQuotesInFontFamily: true,
34278
34306
  replaceNBSP: true,
34279
34307
  replaceOldTags: {
34280
34308
  i: 'em',
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
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
4
+ * Version: v4.15.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.15.4
11
+ * Version: v4.15.5
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */