@sapui5/sap.ui.richtexteditor 1.96.28 → 1.96.30

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 (399) hide show
  1. package/LICENSE.txt +13 -10
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/sap/ui/richtexteditor/.library +3 -3
  5. package/src/sap/ui/richtexteditor/RTESplitButton.js +1 -1
  6. package/src/sap/ui/richtexteditor/js/tiny_mce5/icons/default/icons.js +6 -0
  7. package/src/sap/ui/richtexteditor/js/tiny_mce5/icons/default/icons.min.js +6 -0
  8. package/src/sap/ui/richtexteditor/js/tiny_mce5/jquery.tinymce.min.js +5 -2
  9. package/src/sap/ui/richtexteditor/js/tiny_mce5/langs/he_IL.js +420 -1
  10. package/src/sap/ui/richtexteditor/js/tiny_mce5/license.txt +3 -3
  11. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/advcode/license.txt +3 -3
  12. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/advlist/plugin.js +7 -2
  13. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/advlist/plugin.min.js +7 -2
  14. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/anchor/plugin.js +7 -2
  15. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/anchor/plugin.min.js +7 -2
  16. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/autolink/plugin.js +8 -3
  17. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/autolink/plugin.min.js +8 -3
  18. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/autoresize/plugin.js +7 -2
  19. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/autoresize/plugin.min.js +7 -2
  20. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/autosave/plugin.js +7 -2
  21. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/autosave/plugin.min.js +7 -2
  22. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/bbcode/plugin.js +7 -2
  23. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/bbcode/plugin.min.js +7 -2
  24. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/charmap/plugin.js +7 -2
  25. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/charmap/plugin.min.js +7 -2
  26. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/code/plugin.js +7 -2
  27. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/code/plugin.min.js +7 -2
  28. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/codesample/plugin.js +274 -146
  29. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/codesample/plugin.min.js +8 -3
  30. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/colorpicker/plugin.js +7 -2
  31. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/colorpicker/plugin.min.js +7 -2
  32. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/contextmenu/plugin.js +7 -2
  33. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/contextmenu/plugin.min.js +7 -2
  34. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/directionality/plugin.js +7 -2
  35. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/directionality/plugin.min.js +7 -2
  36. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/emoticons/js/emojiimages.js +6 -0
  37. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/emoticons/js/emojiimages.min.js +6 -0
  38. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/emoticons/js/emojis.js +6 -0
  39. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/emoticons/js/emojis.min.js +6 -0
  40. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/emoticons/plugin.js +7 -2
  41. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/emoticons/plugin.min.js +7 -2
  42. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/fullpage/plugin.js +7 -2
  43. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/fullpage/plugin.min.js +7 -2
  44. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/fullscreen/plugin.js +9 -3
  45. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/fullscreen/plugin.min.js +8 -3
  46. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/help/plugin.js +7 -2
  47. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/help/plugin.min.js +7 -2
  48. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/hr/plugin.js +7 -2
  49. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/hr/plugin.min.js +7 -2
  50. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/image/plugin.js +7 -2
  51. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/image/plugin.min.js +7 -2
  52. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/imagetools/plugin.js +7 -2
  53. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/imagetools/plugin.min.js +7 -2
  54. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/importcss/plugin.js +7 -2
  55. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/importcss/plugin.min.js +7 -2
  56. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/insertdatetime/plugin.js +7 -2
  57. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/insertdatetime/plugin.min.js +7 -2
  58. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/legacyoutput/plugin.js +7 -2
  59. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/legacyoutput/plugin.min.js +7 -2
  60. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/link/plugin.js +7 -2
  61. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/link/plugin.min.js +7 -2
  62. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/lists/plugin.js +7 -2
  63. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/lists/plugin.min.js +7 -2
  64. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/media/plugin.js +7 -2
  65. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/media/plugin.min.js +7 -2
  66. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/nonbreaking/plugin.js +7 -2
  67. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/nonbreaking/plugin.min.js +7 -2
  68. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/noneditable/plugin.js +7 -2
  69. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/noneditable/plugin.min.js +7 -2
  70. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/pagebreak/plugin.js +7 -2
  71. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/pagebreak/plugin.min.js +7 -2
  72. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/paste/plugin.js +8 -3
  73. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/paste/plugin.min.js +8 -3
  74. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/powerpaste/CHANGELOG.md +5 -0
  75. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/powerpaste/license.txt +3 -3
  76. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/powerpaste/plugin.js +2 -2
  77. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/powerpaste/plugin.min.js +2 -2
  78. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/powerpaste/readme.txt +1 -1
  79. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/powerpaste/version.txt +1 -1
  80. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/preview/plugin.js +7 -2
  81. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/preview/plugin.min.js +7 -2
  82. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/print/plugin.js +7 -2
  83. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/print/plugin.min.js +7 -2
  84. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/quickbars/plugin.js +7 -2
  85. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/quickbars/plugin.min.js +7 -2
  86. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/save/plugin.js +7 -2
  87. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/save/plugin.min.js +7 -2
  88. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/searchreplace/plugin.js +7 -2
  89. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/searchreplace/plugin.min.js +7 -2
  90. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/spellchecker/plugin.js +7 -2
  91. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/spellchecker/plugin.min.js +7 -2
  92. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/tabfocus/plugin.js +7 -2
  93. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/tabfocus/plugin.min.js +7 -2
  94. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/table/plugin.js +7 -2
  95. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/table/plugin.min.js +7 -2
  96. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/template/plugin.js +7 -2
  97. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/template/plugin.min.js +7 -2
  98. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/textcolor/plugin.js +7 -2
  99. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/textcolor/plugin.min.js +7 -2
  100. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/textpattern/plugin.js +8 -3
  101. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/textpattern/plugin.min.js +8 -3
  102. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/toc/plugin.js +7 -2
  103. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/toc/plugin.min.js +7 -2
  104. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/visualblocks/plugin.js +7 -2
  105. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/visualblocks/plugin.min.js +7 -2
  106. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/visualchars/plugin.js +7 -2
  107. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/visualchars/plugin.min.js +7 -2
  108. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/wordcount/plugin.js +7 -2
  109. package/src/sap/ui/richtexteditor/js/tiny_mce5/plugins/wordcount/plugin.min.js +7 -2
  110. package/src/sap/ui/richtexteditor/js/tiny_mce5/readme.txt +1 -1
  111. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/dark/content.css +5 -5
  112. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/dark/content.min.css +5 -5
  113. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/default/content.css +5 -5
  114. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/default/content.min.css +5 -5
  115. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/document/content.css +5 -5
  116. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/document/content.min.css +5 -5
  117. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/writer/content.css +5 -5
  118. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/content/writer/content.min.css +5 -5
  119. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/content.css +5 -5
  120. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/content.inline.css +5 -5
  121. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/content.inline.min.css +5 -5
  122. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/content.min.css +5 -5
  123. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/content.mobile.css +5 -5
  124. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/content.mobile.min.css +5 -5
  125. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/skin.css +5 -5
  126. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/skin.min.css +5 -5
  127. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/skin.mobile.css +5 -5
  128. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/skin.mobile.min.css +5 -5
  129. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/skin.shadowdom.css +5 -5
  130. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide/skin.shadowdom.min.css +5 -5
  131. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/content.css +5 -5
  132. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/content.inline.css +5 -5
  133. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/content.inline.min.css +5 -5
  134. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/content.min.css +5 -5
  135. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/content.mobile.css +5 -5
  136. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/content.mobile.min.css +5 -5
  137. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/skin.css +5 -5
  138. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/skin.min.css +5 -5
  139. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/skin.mobile.css +5 -5
  140. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/skin.mobile.min.css +5 -5
  141. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/skin.shadowdom.css +5 -5
  142. package/src/sap/ui/richtexteditor/js/tiny_mce5/skins/ui/oxide-dark/skin.shadowdom.min.css +5 -5
  143. package/src/sap/ui/richtexteditor/js/tiny_mce5/themes/mobile/theme.js +7 -2
  144. package/src/sap/ui/richtexteditor/js/tiny_mce5/themes/mobile/theme.min.js +7 -2
  145. package/src/sap/ui/richtexteditor/js/tiny_mce5/themes/silver/theme.js +1652 -82
  146. package/src/sap/ui/richtexteditor/js/tiny_mce5/themes/silver/theme.min.js +8 -3
  147. package/src/sap/ui/richtexteditor/js/tiny_mce5/tinymce.d.ts +3 -0
  148. package/src/sap/ui/richtexteditor/js/tiny_mce5/tinymce.js +1458 -1360
  149. package/src/sap/ui/richtexteditor/js/tiny_mce5/tinymce.min.js +8 -3
  150. package/src/sap/ui/richtexteditor/js/tiny_mce5/version.txt +1 -1
  151. package/src/sap/ui/richtexteditor/js/tiny_mce6/icons/default/icons.js +3 -0
  152. package/src/sap/ui/richtexteditor/js/tiny_mce6/icons/default/icons.min.js +1 -1
  153. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ar.js +1 -1
  154. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/bg_BG.js +1 -1
  155. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ca.js +1 -1
  156. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/cs.js +1 -1
  157. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/da.js +1 -1
  158. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/de.js +1 -1
  159. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/el.js +1 -1
  160. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/es.js +1 -1
  161. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/eu.js +1 -1
  162. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fa.js +1 -1
  163. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fi.js +1 -1
  164. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/fr_FR.js +1 -1
  165. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/he_IL.js +1 -1
  166. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hi.js +1 -1
  167. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hr.js +1 -1
  168. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/hu_HU.js +1 -1
  169. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/id.js +1 -1
  170. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/it.js +1 -1
  171. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ja.js +1 -1
  172. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/kk.js +1 -1
  173. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ko_KR.js +1 -1
  174. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ms.js +1 -1
  175. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/nb_NO.js +1 -1
  176. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/nl.js +1 -1
  177. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pl.js +1 -1
  178. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pt_BR.js +1 -1
  179. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/pt_PT.js +1 -1
  180. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ro.js +1 -1
  181. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/ru.js +1 -1
  182. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sk.js +1 -1
  183. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sl_SI.js +1 -1
  184. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/sv_SE.js +1 -1
  185. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/th_TH.js +1 -1
  186. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/tr.js +1 -1
  187. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/uk.js +1 -1
  188. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/vi.js +1 -1
  189. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/zh_CN.js +1 -1
  190. package/src/sap/ui/richtexteditor/js/tiny_mce6/langs/zh_TW.js +1 -1
  191. package/src/sap/ui/richtexteditor/js/tiny_mce6/models/dom/model.js +1 -1
  192. package/src/sap/ui/richtexteditor/js/tiny_mce6/models/dom/model.min.js +1 -1
  193. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/accordion/plugin.js +39 -18
  194. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/accordion/plugin.min.js +2 -2
  195. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/CHANGELOG.md +10 -0
  196. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror.min.css +1 -1
  197. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror.min.js +1 -1
  198. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/codemirror_css.js +13 -0
  199. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/customeditor.js +2 -2
  200. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/customeditor.min.js +2 -2
  201. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/plugin.js +2 -2
  202. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/plugin.min.js +2 -2
  203. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/readme.txt +1 -1
  204. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advcode/version.txt +1 -1
  205. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advlist/plugin.js +1 -1
  206. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/advlist/plugin.min.js +1 -1
  207. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/anchor/plugin.js +1 -1
  208. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/anchor/plugin.min.js +1 -1
  209. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autolink/plugin.js +1 -1
  210. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autolink/plugin.min.js +1 -1
  211. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autoresize/plugin.js +1 -1
  212. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autoresize/plugin.min.js +1 -1
  213. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autosave/plugin.js +1 -1
  214. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/autosave/plugin.min.js +1 -1
  215. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/charmap/plugin.js +1 -1
  216. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/charmap/plugin.min.js +1 -1
  217. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/code/plugin.js +1 -1
  218. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/code/plugin.min.js +1 -1
  219. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/codesample/plugin.js +1 -1
  220. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/codesample/plugin.min.js +1 -1
  221. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/directionality/plugin.js +1 -1
  222. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/directionality/plugin.min.js +1 -1
  223. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/emoticons/plugin.js +1 -1
  224. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/emoticons/plugin.min.js +1 -1
  225. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/fullscreen/plugin.js +1 -1
  226. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/fullscreen/plugin.min.js +1 -1
  227. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ar.js +5 -5
  228. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/bg_BG.js +5 -5
  229. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ca.js +5 -5
  230. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/cs.js +5 -5
  231. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/da.js +5 -5
  232. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/de.js +5 -5
  233. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/el.js +5 -5
  234. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/en.js +5 -5
  235. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/es.js +5 -5
  236. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/eu.js +6 -6
  237. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/fa.js +5 -5
  238. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/fi.js +5 -5
  239. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/fr_FR.js +5 -5
  240. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/he_IL.js +5 -5
  241. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/hi.js +5 -5
  242. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/hr.js +5 -5
  243. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/hu_HU.js +5 -5
  244. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/id.js +5 -5
  245. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/it.js +5 -5
  246. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ja.js +5 -5
  247. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/kk.js +5 -5
  248. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ko_KR.js +5 -5
  249. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ms.js +5 -5
  250. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/nb_NO.js +5 -5
  251. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/nl.js +5 -5
  252. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/pl.js +5 -5
  253. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/pt_BR.js +5 -5
  254. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/pt_PT.js +5 -5
  255. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ro.js +5 -5
  256. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/ru.js +5 -5
  257. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/sk.js +5 -5
  258. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/sl_SI.js +5 -5
  259. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/sv_SE.js +5 -5
  260. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/th_TH.js +5 -5
  261. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/tr.js +5 -5
  262. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/uk.js +5 -5
  263. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/vi.js +5 -5
  264. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/zh_CN.js +5 -5
  265. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/js/i18n/keynav/zh_TW.js +5 -5
  266. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/plugin.js +10 -5
  267. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/help/plugin.min.js +2 -2
  268. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/image/plugin.js +4 -3
  269. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/image/plugin.min.js +2 -2
  270. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/importcss/plugin.js +2 -2
  271. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/importcss/plugin.min.js +2 -2
  272. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/insertdatetime/plugin.js +1 -1
  273. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/insertdatetime/plugin.min.js +1 -1
  274. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/link/plugin.js +3 -2
  275. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/link/plugin.min.js +2 -2
  276. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/lists/plugin.js +282 -58
  277. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/lists/plugin.min.js +2 -2
  278. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/media/plugin.js +7 -25
  279. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/media/plugin.min.js +2 -2
  280. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/nonbreaking/plugin.js +1 -1
  281. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/nonbreaking/plugin.min.js +1 -1
  282. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/pagebreak/plugin.js +1 -1
  283. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/pagebreak/plugin.min.js +1 -1
  284. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/CHANGELOG.md +19 -0
  285. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/js/wordimport.js +1972 -1673
  286. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ar.js +0 -1
  287. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/bg_BG.js +0 -1
  288. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ca.js +0 -1
  289. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/cs.js +0 -1
  290. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/da.js +0 -1
  291. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/de.js +0 -1
  292. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/el.js +0 -1
  293. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/es.js +0 -1
  294. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/eu.js +0 -1
  295. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/fa.js +0 -1
  296. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/fi.js +0 -1
  297. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/fr_FR.js +0 -1
  298. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/he_IL.js +0 -1
  299. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/hi.js +0 -1
  300. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/hr.js +0 -1
  301. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/hu_HU.js +0 -1
  302. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/id.js +0 -1
  303. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/it.js +0 -1
  304. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ja.js +0 -1
  305. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/kk.js +0 -1
  306. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ko_KR.js +0 -1
  307. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ms.js +0 -1
  308. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/nb_NO.js +0 -1
  309. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/nl.js +0 -1
  310. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/pl.js +0 -1
  311. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/pt_BR.js +0 -1
  312. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/pt_PT.js +0 -1
  313. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ro.js +0 -1
  314. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/ru.js +0 -1
  315. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/sk.js +0 -1
  316. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/sl_SI.js +0 -1
  317. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/sv_SE.js +0 -1
  318. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/th_TH.js +0 -1
  319. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/tr.js +0 -1
  320. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/uk.js +0 -1
  321. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/vi.js +0 -1
  322. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/zh_CN.js +0 -1
  323. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/langs/zh_TW.js +0 -1
  324. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/plugin.js +2 -2
  325. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/plugin.min.js +2 -2
  326. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/readme.txt +1 -1
  327. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/powerpaste/version.txt +1 -1
  328. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/preview/plugin.js +1 -1
  329. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/preview/plugin.min.js +1 -1
  330. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/quickbars/plugin.js +13 -4
  331. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/quickbars/plugin.min.js +2 -2
  332. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/save/plugin.js +1 -1
  333. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/save/plugin.min.js +1 -1
  334. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/searchreplace/plugin.js +3 -3
  335. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/searchreplace/plugin.min.js +2 -2
  336. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/table/plugin.js +2 -2
  337. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/table/plugin.min.js +2 -2
  338. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/template/plugin.js +1 -1
  339. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/template/plugin.min.js +1 -1
  340. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualblocks/plugin.js +1 -1
  341. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualblocks/plugin.min.js +1 -1
  342. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualchars/plugin.js +1 -1
  343. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/visualchars/plugin.min.js +1 -1
  344. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/wordcount/plugin.js +1 -1
  345. package/src/sap/ui/richtexteditor/js/tiny_mce6/plugins/wordcount/plugin.min.js +1 -1
  346. package/src/sap/ui/richtexteditor/js/tiny_mce6/readme.txt +1 -1
  347. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/content/dark/content.js +8 -0
  348. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/content/default/content.js +8 -0
  349. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/content/document/content.js +8 -0
  350. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/content/tinymce-5/content.js +8 -0
  351. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/content/tinymce-5-dark/content.js +8 -0
  352. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/content/writer/content.js +8 -0
  353. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.css +1 -1
  354. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.css +1 -1
  355. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.js +8 -0
  356. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.inline.min.css +1 -1
  357. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.js +8 -0
  358. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/content.min.css +1 -1
  359. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.css +86 -11
  360. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.js +8 -0
  361. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.min.css +1 -1
  362. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide/skin.shadowdom.js +8 -0
  363. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.css +1 -1
  364. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.css +1 -1
  365. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.js +8 -0
  366. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.inline.min.css +1 -1
  367. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.js +8 -0
  368. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/content.min.css +1 -1
  369. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.css +89 -14
  370. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.js +8 -0
  371. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.min.css +1 -1
  372. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/oxide-dark/skin.shadowdom.js +8 -0
  373. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.css +1 -1
  374. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.css +1 -1
  375. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.js +8 -0
  376. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.inline.min.css +1 -1
  377. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.js +8 -0
  378. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/content.min.css +1 -1
  379. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.css +86 -11
  380. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.js +8 -0
  381. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.min.css +1 -1
  382. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5/skin.shadowdom.js +8 -0
  383. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.css +1 -1
  384. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.css +1 -1
  385. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.js +8 -0
  386. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  387. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.js +8 -0
  388. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/content.min.css +1 -1
  389. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.css +86 -11
  390. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.js +8 -0
  391. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  392. package/src/sap/ui/richtexteditor/js/tiny_mce6/skins/ui/tinymce-5-dark/skin.shadowdom.js +8 -0
  393. package/src/sap/ui/richtexteditor/js/tiny_mce6/themes/silver/theme.js +20786 -20200
  394. package/src/sap/ui/richtexteditor/js/tiny_mce6/themes/silver/theme.min.js +2 -2
  395. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.d.ts +40 -8
  396. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.js +2031 -1572
  397. package/src/sap/ui/richtexteditor/js/tiny_mce6/tinymce.min.js +2 -2
  398. package/src/sap/ui/richtexteditor/js/tiny_mce6/version.txt +1 -1
  399. package/src/sap/ui/richtexteditor/library.js +1 -1
@@ -1,5 +1,10 @@
1
- /**
2
- * Copyright (c) Tiny Technologies, Inc. All rights reserved.
1
+ /*!
2
+ * TinyMCE
3
+ *
4
+ * Copyright (c) 2023 Ephox Corporation DBA Tiny Technologies, Inc.
5
+ * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
6
+ *
7
+ * Version: 5.10.9
3
8
  */
4
9
  (function () {
5
10
  'use strict';
@@ -801,7 +806,7 @@
801
806
  return s.replace(r, '');
802
807
  };
803
808
  };
804
- var trim$4 = blank(/^\s+|\s+$/g);
809
+ var trim$5 = blank(/^\s+|\s+$/g);
805
810
  var lTrim = blank(/^\s+/g);
806
811
  var rTrim = blank(/\s+$/g);
807
812
  var isNotEmpty = function (s) {
@@ -1104,7 +1109,7 @@
1104
1109
  };
1105
1110
 
1106
1111
  var whiteSpaceRegExp$2 = /^\s*|\s*$/g;
1107
- var trim$3 = function (str) {
1112
+ var trim$4 = function (str) {
1108
1113
  return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp$2, '');
1109
1114
  };
1110
1115
  var is$3 = function (obj, type) {
@@ -1250,7 +1255,7 @@
1250
1255
  if (!s || is$3(s, 'array')) {
1251
1256
  return s;
1252
1257
  }
1253
- return map$1(s.split(d || ','), trim$3);
1258
+ return map$1(s.split(d || ','), trim$4);
1254
1259
  };
1255
1260
  var _addCacheSuffix = function (url) {
1256
1261
  var cacheSuffix = Env.cacheSuffix;
@@ -1260,7 +1265,7 @@
1260
1265
  return url;
1261
1266
  };
1262
1267
  var Tools = {
1263
- trim: trim$3,
1268
+ trim: trim$4,
1264
1269
  isArray: isArray,
1265
1270
  is: is$3,
1266
1271
  toArray: toArray$1,
@@ -3084,7 +3089,7 @@
3084
3089
 
3085
3090
  var ZWSP$1 = zeroWidth;
3086
3091
  var isZwsp = isZwsp$1;
3087
- var trim$2 = removeZwsp;
3092
+ var trim$3 = removeZwsp;
3088
3093
 
3089
3094
  var isElement$4 = isElement$5;
3090
3095
  var isText$6 = isText$7;
@@ -3536,6 +3541,13 @@
3536
3541
  items = Tools.trim(items);
3537
3542
  return items ? items.split(delim || ' ') : [];
3538
3543
  };
3544
+ var createMap = function (defaultValue, extendWith) {
3545
+ var value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' '));
3546
+ return extend$5(value, extendWith);
3547
+ };
3548
+ var getTextRootBlockElements = function (schema) {
3549
+ return createMap('td th li dt dd figcaption caption details summary', schema.getTextBlockElements());
3550
+ };
3539
3551
  var compileSchema = function (type) {
3540
3552
  var schema = {};
3541
3553
  var globalAttributes, blockContent;
@@ -3795,8 +3807,7 @@
3795
3807
  if (!value) {
3796
3808
  value = mapCache[option];
3797
3809
  if (!value) {
3798
- value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' '));
3799
- value = extend$5(value, extendWith);
3810
+ value = createMap(defaultValue, extendWith);
3800
3811
  mapCache[option] = value;
3801
3812
  }
3802
3813
  } else {
@@ -3821,7 +3832,7 @@
3821
3832
  var moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' table', shortEndedElementsMap);
3822
3833
  var textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside main nav figure');
3823
3834
  var blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap);
3824
- var textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
3835
+ var textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font s strike u var cite ' + 'dfn code mark q sup sub samp');
3825
3836
  each$h((settings.special || 'script noscript iframe noframes noembed title style textarea xmp').split(' '), function (name) {
3826
3837
  specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
3827
3838
  });
@@ -4026,7 +4037,15 @@
4026
4037
  elements[items[1]].outputName = items[0];
4027
4038
  });
4028
4039
  }
4029
- each$h(split$1('ol ul sub sup blockquote span font a table tbody strong em b i'), function (name) {
4040
+ each$h(textInlineElementsMap, function (_val, name) {
4041
+ if (elements[name]) {
4042
+ if (settings.padd_empty_block_inline_children) {
4043
+ elements[name].paddInEmptyBlock = true;
4044
+ }
4045
+ elements[name].removeEmpty = true;
4046
+ }
4047
+ });
4048
+ each$h(split$1('ol ul blockquote a table tbody'), function (name) {
4030
4049
  if (elements[name]) {
4031
4050
  elements[name].removeEmpty = true;
4032
4051
  }
@@ -5838,7 +5857,7 @@
5838
5857
  return -1;
5839
5858
  };
5840
5859
  var whiteSpaceRegExp = /^\s*|\s*$/g;
5841
- var trim$1 = function (str) {
5860
+ var trim$2 = function (str) {
5842
5861
  return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp, '');
5843
5862
  };
5844
5863
  var each$g = function (obj, callback) {
@@ -6235,7 +6254,7 @@
6235
6254
  if (classState !== state) {
6236
6255
  var existingClassName = node.className;
6237
6256
  if (classState) {
6238
- node.className = trim$1((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' '));
6257
+ node.className = trim$2((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' '));
6239
6258
  } else {
6240
6259
  node.className += existingClassName ? ' ' + className : className;
6241
6260
  }
@@ -6358,7 +6377,7 @@
6358
6377
  inArray: inArray$1,
6359
6378
  isArray: Tools.isArray,
6360
6379
  each: each$g,
6361
- trim: trim$1,
6380
+ trim: trim$2,
6362
6381
  grep: grep$2,
6363
6382
  find: Sizzle,
6364
6383
  expr: Sizzle.selectors,
@@ -8963,7 +8982,7 @@
8963
8982
  };
8964
8983
  var getBookmark$2 = function (selection, type, normalized) {
8965
8984
  if (type === 2) {
8966
- return getOffsetBookmark(trim$2, normalized, selection);
8985
+ return getOffsetBookmark(trim$3, normalized, selection);
8967
8986
  } else if (type === 3) {
8968
8987
  return getCaretBookmark(selection);
8969
8988
  } else if (type) {
@@ -9091,7 +9110,7 @@
9091
9110
  var getContentCss = function (editor) {
9092
9111
  var contentCss = editor.getParam('content_css');
9093
9112
  if (isString$1(contentCss)) {
9094
- return map$3(contentCss.split(','), trim$4);
9113
+ return map$3(contentCss.split(','), trim$5);
9095
9114
  } else if (isArray$1(contentCss)) {
9096
9115
  return contentCss;
9097
9116
  } else if (contentCss === false || editor.inline) {
@@ -9102,7 +9121,7 @@
9102
9121
  };
9103
9122
  var getFontCss = function (editor) {
9104
9123
  var fontCss = editor.getParam('font_css', []);
9105
- return isArray$1(fontCss) ? fontCss : map$3(fontCss.split(','), trim$4);
9124
+ return isArray$1(fontCss) ? fontCss : map$3(fontCss.split(','), trim$5);
9106
9125
  };
9107
9126
  var getDirectionality = function (editor) {
9108
9127
  return editor.getParam('directionality', I18n.isRtl() ? 'rtl' : undefined);
@@ -9223,7 +9242,7 @@
9223
9242
  }
9224
9243
  };
9225
9244
  var trimCount = function (text) {
9226
- var trimmedText = trim$2(text);
9245
+ var trimmedText = trim$3(text);
9227
9246
  return {
9228
9247
  count: text.length - trimmedText.length,
9229
9248
  text: trimmedText
@@ -11421,7 +11440,7 @@
11421
11440
  updateResizeRect(e);
11422
11441
  }
11423
11442
  });
11424
- editor.on('nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged', throttledUpdateResizeRect);
11443
+ editor.on('NodeChange ResizeEditor ResizeWindow ResizeContent drop', throttledUpdateResizeRect);
11425
11444
  editor.on('keyup compositionend', function (e) {
11426
11445
  if (selectedElm && selectedElm.nodeName === 'TABLE') {
11427
11446
  throttledUpdateResizeRect(e);
@@ -12868,1197 +12887,523 @@
12868
12887
  return AstNode;
12869
12888
  }();
12870
12889
 
12871
- var extractBase64DataUris = function (html) {
12872
- var dataImageUri = /data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi;
12873
- var chunks = [];
12874
- var uris = {};
12875
- var prefix = generate('img');
12876
- var matches;
12877
- var index = 0;
12878
- var count = 0;
12879
- while (matches = dataImageUri.exec(html)) {
12880
- var uri = matches[0];
12881
- var imageId = prefix + '_' + count++;
12882
- uris[imageId] = uri;
12883
- if (index < matches.index) {
12884
- chunks.push(html.substr(index, matches.index - index));
12885
- }
12886
- chunks.push(imageId);
12887
- index = matches.index + uri.length;
12888
- }
12889
- var re = new RegExp(prefix + '_[0-9]+', 'g');
12890
- if (index === 0) {
12891
- return {
12892
- prefix: prefix,
12893
- uris: uris,
12894
- html: html,
12895
- re: re
12896
- };
12897
- } else {
12898
- if (index < html.length) {
12899
- chunks.push(html.substr(index));
12890
+ var unescapedTextParents = Tools.makeMap('NOSCRIPT STYLE SCRIPT XMP IFRAME NOEMBED NOFRAMES PLAINTEXT', ' ');
12891
+ var containsZwsp = function (node) {
12892
+ return isString$1(node.nodeValue) && contains$2(node.nodeValue, ZWSP$1);
12893
+ };
12894
+ var getTemporaryNodeSelector = function (tempAttrs) {
12895
+ return (tempAttrs.length === 0 ? '' : map$3(tempAttrs, function (attr) {
12896
+ return '[' + attr + ']';
12897
+ }).join(',') + ',') + '[data-mce-bogus="all"]';
12898
+ };
12899
+ var getTemporaryNodes = function (tempAttrs, body) {
12900
+ return body.querySelectorAll(getTemporaryNodeSelector(tempAttrs));
12901
+ };
12902
+ var createWalker = function (body, whatToShow, filter) {
12903
+ return document.createTreeWalker(body, whatToShow, filter, false);
12904
+ };
12905
+ var createZwspCommentWalker = function (body) {
12906
+ return createWalker(body, NodeFilter.SHOW_COMMENT, function (node) {
12907
+ return containsZwsp(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
12908
+ });
12909
+ };
12910
+ var createUnescapedZwspTextWalker = function (body) {
12911
+ return createWalker(body, NodeFilter.SHOW_TEXT, function (node) {
12912
+ if (containsZwsp(node)) {
12913
+ var parent_1 = node.parentNode;
12914
+ return parent_1 && has$2(unescapedTextParents, parent_1.nodeName) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
12915
+ } else {
12916
+ return NodeFilter.FILTER_SKIP;
12900
12917
  }
12901
- return {
12902
- prefix: prefix,
12903
- uris: uris,
12904
- html: chunks.join(''),
12905
- re: re
12906
- };
12907
- }
12918
+ });
12908
12919
  };
12909
- var restoreDataUris = function (html, result) {
12910
- return html.replace(result.re, function (imageId) {
12911
- return get$9(result.uris, imageId).getOr(imageId);
12920
+ var hasZwspComment = function (body) {
12921
+ return createZwspCommentWalker(body).nextNode() !== null;
12922
+ };
12923
+ var hasUnescapedZwspText = function (body) {
12924
+ return createUnescapedZwspTextWalker(body).nextNode() !== null;
12925
+ };
12926
+ var hasTemporaryNode = function (tempAttrs, body) {
12927
+ return body.querySelector(getTemporaryNodeSelector(tempAttrs)) !== null;
12928
+ };
12929
+ var trimTemporaryNodes = function (tempAttrs, body) {
12930
+ each$k(getTemporaryNodes(tempAttrs, body), function (elm) {
12931
+ var element = SugarElement.fromDom(elm);
12932
+ if (get$6(element, 'data-mce-bogus') === 'all') {
12933
+ remove$7(element);
12934
+ } else {
12935
+ each$k(tempAttrs, function (attr) {
12936
+ if (has$1(element, attr)) {
12937
+ remove$6(element, attr);
12938
+ }
12939
+ });
12940
+ }
12912
12941
  });
12913
12942
  };
12914
- var parseDataUri$1 = function (uri) {
12915
- var matches = /data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(uri);
12916
- if (matches) {
12917
- return Optional.some({
12918
- type: matches[1],
12919
- data: decodeURIComponent(matches[2])
12920
- });
12921
- } else {
12922
- return Optional.none();
12943
+ var emptyAllNodeValuesInWalker = function (walker) {
12944
+ var curr = walker.nextNode();
12945
+ while (curr !== null) {
12946
+ curr.nodeValue = null;
12947
+ curr = walker.nextNode();
12923
12948
  }
12924
12949
  };
12950
+ var emptyZwspComments = compose(emptyAllNodeValuesInWalker, createZwspCommentWalker);
12951
+ var emptyUnescapedZwspTexts = compose(emptyAllNodeValuesInWalker, createUnescapedZwspTextWalker);
12952
+ var trim$1 = function (body, tempAttrs) {
12953
+ var conditionalTrims = [
12954
+ {
12955
+ condition: curry(hasTemporaryNode, tempAttrs),
12956
+ action: curry(trimTemporaryNodes, tempAttrs)
12957
+ },
12958
+ {
12959
+ condition: hasZwspComment,
12960
+ action: emptyZwspComments
12961
+ },
12962
+ {
12963
+ condition: hasUnescapedZwspText,
12964
+ action: emptyUnescapedZwspTexts
12965
+ }
12966
+ ];
12967
+ var trimmed = body;
12968
+ var cloned = false;
12969
+ each$k(conditionalTrims, function (_a) {
12970
+ var condition = _a.condition, action = _a.action;
12971
+ if (condition(trimmed)) {
12972
+ if (!cloned) {
12973
+ trimmed = body.cloneNode(true);
12974
+ cloned = true;
12975
+ }
12976
+ action(trimmed);
12977
+ }
12978
+ });
12979
+ return trimmed;
12980
+ };
12925
12981
 
12926
- var each$d = Tools.each, trim = Tools.trim;
12927
- var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
12928
- var DEFAULT_PORTS = {
12929
- ftp: 21,
12930
- http: 80,
12931
- https: 443,
12932
- mailto: 25
12982
+ var trimEmptyContents = function (editor, html) {
12983
+ var blockName = getForcedRootBlock(editor);
12984
+ var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>(&nbsp;|&#160;|\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
12985
+ return html.replace(emptyRegExp, '');
12933
12986
  };
12934
- var safeSvgDataUrlElements = [
12935
- 'img',
12936
- 'video'
12937
- ];
12938
- var blockSvgDataUris = function (allowSvgDataUrls, tagName) {
12939
- if (isNonNullable(allowSvgDataUrls)) {
12940
- return !allowSvgDataUrls;
12987
+ var setupArgs$3 = function (args, format) {
12988
+ return __assign(__assign({}, args), {
12989
+ format: format,
12990
+ get: true,
12991
+ getInner: true
12992
+ });
12993
+ };
12994
+ var getContentFromBody = function (editor, args, format, body) {
12995
+ var defaultedArgs = setupArgs$3(args, format);
12996
+ var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeGetContent', defaultedArgs);
12997
+ var content;
12998
+ if (updatedArgs.format === 'raw') {
12999
+ content = Tools.trim(trim$3(trim$1(body, editor.serializer.getTempAttrs()).innerHTML));
13000
+ } else if (updatedArgs.format === 'text') {
13001
+ content = editor.dom.isEmpty(body) ? '' : trim$3(body.innerText || body.textContent);
13002
+ } else if (updatedArgs.format === 'tree') {
13003
+ content = editor.serializer.serialize(body, updatedArgs);
12941
13004
  } else {
12942
- return isNonNullable(tagName) ? !contains$3(safeSvgDataUrlElements, tagName) : true;
13005
+ content = trimEmptyContents(editor, editor.serializer.serialize(body, updatedArgs));
12943
13006
  }
12944
- };
12945
- var isInvalidUri = function (settings, uri, tagName) {
12946
- if (settings.allow_html_data_urls) {
12947
- return false;
12948
- } else if (/^data:image\//i.test(uri)) {
12949
- return blockSvgDataUris(settings.allow_svg_data_urls, tagName) && /^data:image\/svg\+xml/i.test(uri);
13007
+ if (!contains$3([
13008
+ 'text',
13009
+ 'tree'
13010
+ ], updatedArgs.format) && !isWsPreserveElement(SugarElement.fromDom(body))) {
13011
+ updatedArgs.content = Tools.trim(content);
12950
13012
  } else {
12951
- return /^data:/i.test(uri);
13013
+ updatedArgs.content = content;
13014
+ }
13015
+ if (updatedArgs.no_events) {
13016
+ return updatedArgs.content;
13017
+ } else {
13018
+ return editor.fire('GetContent', updatedArgs).content;
12952
13019
  }
12953
13020
  };
12954
- var URI = function () {
12955
- function URI(url, settings) {
12956
- url = trim(url);
12957
- this.settings = settings || {};
12958
- var baseUri = this.settings.base_uri;
12959
- var self = this;
12960
- if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
12961
- self.source = url;
12962
- return;
12963
- }
12964
- var isProtocolRelative = url.indexOf('//') === 0;
12965
- if (url.indexOf('/') === 0 && !isProtocolRelative) {
12966
- url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
12967
- }
12968
- if (!/^[\w\-]*:?\/\//.test(url)) {
12969
- var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
12970
- if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
12971
- url = '//mce_host' + self.toAbsPath(baseUrl, url);
12972
- } else {
12973
- var match = /([^#?]*)([#?]?.*)/.exec(url);
12974
- url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
12975
- }
13021
+ var getContentInternal = function (editor, args, format) {
13022
+ return Optional.from(editor.getBody()).fold(constant(args.format === 'tree' ? new AstNode('body', 11) : ''), function (body) {
13023
+ return getContentFromBody(editor, args, format, body);
13024
+ });
13025
+ };
13026
+
13027
+ var each$d = Tools.each;
13028
+ var ElementUtils = function (dom) {
13029
+ var compare = function (node1, node2) {
13030
+ if (node1.nodeName !== node2.nodeName) {
13031
+ return false;
12976
13032
  }
12977
- url = url.replace(/@@/g, '(mce_at)');
12978
- var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
12979
- each$d(queryParts, function (v, i) {
12980
- var part = urlMatch[i];
12981
- if (part) {
12982
- part = part.replace(/\(mce_at\)/g, '@@');
12983
- }
12984
- self[v] = part;
12985
- });
12986
- if (baseUri) {
12987
- if (!self.protocol) {
12988
- self.protocol = baseUri.protocol;
12989
- }
12990
- if (!self.userInfo) {
12991
- self.userInfo = baseUri.userInfo;
12992
- }
12993
- if (!self.port && self.host === 'mce_host') {
12994
- self.port = baseUri.port;
13033
+ var getAttribs = function (node) {
13034
+ var attribs = {};
13035
+ each$d(dom.getAttribs(node), function (attr) {
13036
+ var name = attr.nodeName.toLowerCase();
13037
+ if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
13038
+ attribs[name] = dom.getAttrib(node, name);
13039
+ }
13040
+ });
13041
+ return attribs;
13042
+ };
13043
+ var compareObjects = function (obj1, obj2) {
13044
+ var value, name;
13045
+ for (name in obj1) {
13046
+ if (has$2(obj1, name)) {
13047
+ value = obj2[name];
13048
+ if (typeof value === 'undefined') {
13049
+ return false;
13050
+ }
13051
+ if (obj1[name] !== value) {
13052
+ return false;
13053
+ }
13054
+ delete obj2[name];
13055
+ }
12995
13056
  }
12996
- if (!self.host || self.host === 'mce_host') {
12997
- self.host = baseUri.host;
13057
+ for (name in obj2) {
13058
+ if (has$2(obj2, name)) {
13059
+ return false;
13060
+ }
12998
13061
  }
12999
- self.source = '';
13000
- }
13001
- if (isProtocolRelative) {
13002
- self.protocol = '';
13003
- }
13004
- }
13005
- URI.parseDataUri = function (uri) {
13006
- var type;
13007
- var uriComponents = decodeURIComponent(uri).split(',');
13008
- var matches = /data:([^;]+)/.exec(uriComponents[0]);
13009
- if (matches) {
13010
- type = matches[1];
13011
- }
13012
- return {
13013
- type: type,
13014
- data: uriComponents[1]
13062
+ return true;
13015
13063
  };
13016
- };
13017
- URI.isDomSafe = function (uri, context, options) {
13018
- if (options === void 0) {
13019
- options = {};
13064
+ if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
13065
+ return false;
13020
13066
  }
13021
- if (options.allow_script_urls) {
13022
- return true;
13023
- } else {
13024
- var decodedUri = Entities.decode(uri).replace(/[\s\u0000-\u001F]+/g, '');
13025
- try {
13026
- decodedUri = decodeURIComponent(decodedUri);
13027
- } catch (ex) {
13028
- decodedUri = unescape(decodedUri);
13029
- }
13030
- if (/((java|vb)script|mhtml):/i.test(decodedUri)) {
13031
- return false;
13032
- }
13033
- return !isInvalidUri(options, decodedUri, context);
13067
+ if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
13068
+ return false;
13034
13069
  }
13070
+ return !isBookmarkNode$1(node1) && !isBookmarkNode$1(node2);
13035
13071
  };
13036
- URI.getDocumentBaseUrl = function (loc) {
13037
- var baseUrl;
13038
- if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
13039
- baseUrl = loc.href;
13040
- } else {
13041
- baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
13042
- }
13043
- if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
13044
- baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
13045
- if (!/[\/\\]$/.test(baseUrl)) {
13046
- baseUrl += '/';
13047
- }
13048
- }
13049
- return baseUrl;
13050
- };
13051
- URI.prototype.setPath = function (path) {
13052
- var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
13053
- this.path = pathMatch[0];
13054
- this.directory = pathMatch[1];
13055
- this.file = pathMatch[2];
13056
- this.source = '';
13057
- this.getURI();
13058
- };
13059
- URI.prototype.toRelative = function (uri) {
13060
- var output;
13061
- if (uri === './') {
13062
- return uri;
13063
- }
13064
- var relativeUri = new URI(uri, { base_uri: this });
13065
- if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
13066
- return relativeUri.getURI();
13067
- }
13068
- var tu = this.getURI(), uu = relativeUri.getURI();
13069
- if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
13070
- return tu;
13071
- }
13072
- output = this.toRelPath(this.path, relativeUri.path);
13073
- if (relativeUri.query) {
13074
- output += '?' + relativeUri.query;
13075
- }
13076
- if (relativeUri.anchor) {
13077
- output += '#' + relativeUri.anchor;
13078
- }
13079
- return output;
13080
- };
13081
- URI.prototype.toAbsolute = function (uri, noHost) {
13082
- var absoluteUri = new URI(uri, { base_uri: this });
13083
- return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
13084
- };
13085
- URI.prototype.isSameOrigin = function (uri) {
13086
- if (this.host == uri.host && this.protocol == uri.protocol) {
13087
- if (this.port == uri.port) {
13088
- return true;
13089
- }
13090
- var defaultPort = DEFAULT_PORTS[this.protocol];
13091
- if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
13092
- return true;
13093
- }
13094
- }
13095
- return false;
13096
- };
13097
- URI.prototype.toRelPath = function (base, path) {
13098
- var breakPoint = 0, out = '', i, l;
13099
- var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
13100
- var items = path.split('/');
13101
- if (normalizedBase.length >= items.length) {
13102
- for (i = 0, l = normalizedBase.length; i < l; i++) {
13103
- if (i >= items.length || normalizedBase[i] !== items[i]) {
13104
- breakPoint = i + 1;
13105
- break;
13072
+ return { compare: compare };
13073
+ };
13074
+
13075
+ var makeMap$1 = Tools.makeMap;
13076
+ var Writer = function (settings) {
13077
+ var html = [];
13078
+ settings = settings || {};
13079
+ var indent = settings.indent;
13080
+ var indentBefore = makeMap$1(settings.indent_before || '');
13081
+ var indentAfter = makeMap$1(settings.indent_after || '');
13082
+ var encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
13083
+ var htmlOutput = settings.element_format === 'html';
13084
+ return {
13085
+ start: function (name, attrs, empty) {
13086
+ var i, l, attr, value;
13087
+ if (indent && indentBefore[name] && html.length > 0) {
13088
+ value = html[html.length - 1];
13089
+ if (value.length > 0 && value !== '\n') {
13090
+ html.push('\n');
13106
13091
  }
13107
13092
  }
13108
- }
13109
- if (normalizedBase.length < items.length) {
13110
- for (i = 0, l = items.length; i < l; i++) {
13111
- if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
13112
- breakPoint = i + 1;
13113
- break;
13093
+ html.push('<', name);
13094
+ if (attrs) {
13095
+ for (i = 0, l = attrs.length; i < l; i++) {
13096
+ attr = attrs[i];
13097
+ html.push(' ', attr.name, '="', encode(attr.value, true), '"');
13114
13098
  }
13115
13099
  }
13116
- }
13117
- if (breakPoint === 1) {
13118
- return path;
13119
- }
13120
- for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
13121
- out += '../';
13122
- }
13123
- for (i = breakPoint - 1, l = items.length; i < l; i++) {
13124
- if (i !== breakPoint - 1) {
13125
- out += '/' + items[i];
13100
+ if (!empty || htmlOutput) {
13101
+ html[html.length] = '>';
13126
13102
  } else {
13127
- out += items[i];
13128
- }
13129
- }
13130
- return out;
13131
- };
13132
- URI.prototype.toAbsPath = function (base, path) {
13133
- var i, nb = 0, o = [], outPath;
13134
- var tr = /\/$/.test(path) ? '/' : '';
13135
- var normalizedBase = base.split('/');
13136
- var normalizedPath = path.split('/');
13137
- each$d(normalizedBase, function (k) {
13138
- if (k) {
13139
- o.push(k);
13140
- }
13141
- });
13142
- normalizedBase = o;
13143
- for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
13144
- if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
13145
- continue;
13146
- }
13147
- if (normalizedPath[i] === '..') {
13148
- nb++;
13149
- continue;
13150
- }
13151
- if (nb > 0) {
13152
- nb--;
13153
- continue;
13103
+ html[html.length] = ' />';
13154
13104
  }
13155
- o.push(normalizedPath[i]);
13156
- }
13157
- i = normalizedBase.length - nb;
13158
- if (i <= 0) {
13159
- outPath = reverse(o).join('/');
13160
- } else {
13161
- outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
13162
- }
13163
- if (outPath.indexOf('/') !== 0) {
13164
- outPath = '/' + outPath;
13165
- }
13166
- if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
13167
- outPath += tr;
13168
- }
13169
- return outPath;
13170
- };
13171
- URI.prototype.getURI = function (noProtoHost) {
13172
- if (noProtoHost === void 0) {
13173
- noProtoHost = false;
13174
- }
13175
- var s;
13176
- if (!this.source || noProtoHost) {
13177
- s = '';
13178
- if (!noProtoHost) {
13179
- if (this.protocol) {
13180
- s += this.protocol + '://';
13181
- } else {
13182
- s += '//';
13183
- }
13184
- if (this.userInfo) {
13185
- s += this.userInfo + '@';
13186
- }
13187
- if (this.host) {
13188
- s += this.host;
13105
+ if (empty && indent && indentAfter[name] && html.length > 0) {
13106
+ value = html[html.length - 1];
13107
+ if (value.length > 0 && value !== '\n') {
13108
+ html.push('\n');
13189
13109
  }
13190
- if (this.port) {
13191
- s += ':' + this.port;
13110
+ }
13111
+ },
13112
+ end: function (name) {
13113
+ var value;
13114
+ html.push('</', name, '>');
13115
+ if (indent && indentAfter[name] && html.length > 0) {
13116
+ value = html[html.length - 1];
13117
+ if (value.length > 0 && value !== '\n') {
13118
+ html.push('\n');
13192
13119
  }
13193
13120
  }
13194
- if (this.path) {
13195
- s += this.path;
13121
+ },
13122
+ text: function (text, raw) {
13123
+ if (text.length > 0) {
13124
+ html[html.length] = raw ? text : encode(text);
13196
13125
  }
13197
- if (this.query) {
13198
- s += '?' + this.query;
13126
+ },
13127
+ cdata: function (text) {
13128
+ html.push('<![CDATA[', text, ']]>');
13129
+ },
13130
+ comment: function (text) {
13131
+ html.push('<!--', text, '-->');
13132
+ },
13133
+ pi: function (name, text) {
13134
+ if (text) {
13135
+ html.push('<?', name, ' ', encode(text), '?>');
13136
+ } else {
13137
+ html.push('<?', name, '?>');
13199
13138
  }
13200
- if (this.anchor) {
13201
- s += '#' + this.anchor;
13139
+ if (indent) {
13140
+ html.push('\n');
13202
13141
  }
13203
- this.source = s;
13142
+ },
13143
+ doctype: function (text) {
13144
+ html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
13145
+ },
13146
+ reset: function () {
13147
+ html.length = 0;
13148
+ },
13149
+ getContent: function () {
13150
+ return html.join('').replace(/\n$/, '');
13204
13151
  }
13205
- return this.source;
13206
13152
  };
13207
- return URI;
13208
- }();
13209
-
13210
- var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
13211
- var isValidPrefixAttrName = function (name) {
13212
- return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
13213
13153
  };
13214
- var findMatchingEndTagIndex = function (schema, html, startIndex) {
13215
- var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
13216
- var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
13217
- var shortEndedElements = schema.getShortEndedElements();
13218
- var count = 1, index = startIndex;
13219
- while (count !== 0) {
13220
- startTagRegExp.lastIndex = index;
13221
- while (true) {
13222
- var startMatch = startTagRegExp.exec(html);
13223
- if (startMatch === null) {
13224
- return index;
13225
- } else if (startMatch[1] === '!') {
13226
- if (startsWith(startMatch[2], '--')) {
13227
- index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
13228
- } else {
13229
- index = findCommentEndIndex(html, true, startMatch.index + 1);
13230
- }
13231
- break;
13232
- } else {
13233
- endTagRegExp.lastIndex = startTagRegExp.lastIndex;
13234
- var endMatch = endTagRegExp.exec(html);
13235
- if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
13236
- continue;
13237
- }
13238
- if (startMatch[1] === '/') {
13239
- count -= 1;
13240
- } else if (!has$2(shortEndedElements, startMatch[2])) {
13241
- count += 1;
13242
- }
13243
- index = startTagRegExp.lastIndex + endMatch[0].length;
13244
- break;
13245
- }
13246
- }
13247
- }
13248
- return index;
13249
- };
13250
- var isConditionalComment = function (html, startIndex) {
13251
- return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(html.substr(startIndex));
13252
- };
13253
- var findCommentEndIndex = function (html, isBogus, startIndex) {
13254
- if (startIndex === void 0) {
13255
- startIndex = 0;
13256
- }
13257
- var lcHtml = html.toLowerCase();
13258
- if (lcHtml.indexOf('[if ', startIndex) !== -1 && isConditionalComment(lcHtml, startIndex)) {
13259
- var endIfIndex = lcHtml.indexOf('[endif]', startIndex);
13260
- return lcHtml.indexOf('>', endIfIndex);
13261
- } else {
13262
- if (isBogus) {
13263
- var endIndex = lcHtml.indexOf('>', startIndex);
13264
- return endIndex !== -1 ? endIndex : lcHtml.length;
13265
- } else {
13266
- var endCommentRegexp = /--!?>/g;
13267
- endCommentRegexp.lastIndex = startIndex;
13268
- var match = endCommentRegexp.exec(html);
13269
- return match ? match.index + match[0].length : lcHtml.length;
13270
- }
13271
- }
13272
- };
13273
- var checkBogusAttribute = function (regExp, attrString) {
13274
- var matches = regExp.exec(attrString);
13275
- if (matches) {
13276
- var name_1 = matches[1];
13277
- var value = matches[2];
13278
- return typeof name_1 === 'string' && name_1.toLowerCase() === 'data-mce-bogus' ? value : null;
13279
- } else {
13280
- return null;
13281
- }
13282
- };
13283
- var SaxParser = function (settings, schema) {
13284
- var _a;
13154
+
13155
+ var HtmlSerializer = function (settings, schema) {
13285
13156
  if (schema === void 0) {
13286
13157
  schema = Schema();
13287
13158
  }
13159
+ var writer = Writer(settings);
13288
13160
  settings = settings || {};
13289
- var doc = (_a = settings.document) !== null && _a !== void 0 ? _a : document;
13290
- var form = doc.createElement('form');
13291
- if (settings.fix_self_closing !== false) {
13292
- settings.fix_self_closing = true;
13293
- }
13294
- var comment = settings.comment ? settings.comment : noop;
13295
- var cdata = settings.cdata ? settings.cdata : noop;
13296
- var text = settings.text ? settings.text : noop;
13297
- var start = settings.start ? settings.start : noop;
13298
- var end = settings.end ? settings.end : noop;
13299
- var pi = settings.pi ? settings.pi : noop;
13300
- var doctype = settings.doctype ? settings.doctype : noop;
13301
- var parseInternal = function (base64Extract, format) {
13302
- if (format === void 0) {
13303
- format = 'html';
13304
- }
13305
- var html = base64Extract.html;
13306
- var matches, index = 0, value, endRegExp;
13307
- var stack = [];
13308
- var attrList, i, textData, name;
13309
- var isInternalElement, isShortEnded;
13310
- var elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
13311
- var attributesRequired, attributesDefault, attributesForced;
13312
- var anyAttributesRequired, attrValue, idCount = 0;
13313
- var decode = Entities.decode;
13314
- var filteredUrlAttrs = Tools.makeMap('src,href,data,background,action,formaction,poster,xlink:href');
13315
- var parsingMode = format === 'html' ? 0 : 1;
13316
- var processEndTag = function (name) {
13317
- var pos, i;
13318
- pos = stack.length;
13319
- while (pos--) {
13320
- if (stack[pos].name === name) {
13321
- break;
13322
- }
13323
- }
13324
- if (pos >= 0) {
13325
- for (i = stack.length - 1; i >= pos; i--) {
13326
- name = stack[i];
13327
- if (name.valid) {
13328
- end(name.name);
13329
- }
13161
+ settings.validate = 'validate' in settings ? settings.validate : true;
13162
+ var serialize = function (node) {
13163
+ var validate = settings.validate;
13164
+ var handlers = {
13165
+ 3: function (node) {
13166
+ writer.text(node.value, node.raw);
13167
+ },
13168
+ 8: function (node) {
13169
+ writer.comment(node.value);
13170
+ },
13171
+ 7: function (node) {
13172
+ writer.pi(node.name, node.value);
13173
+ },
13174
+ 10: function (node) {
13175
+ writer.doctype(node.value);
13176
+ },
13177
+ 4: function (node) {
13178
+ writer.cdata(node.value);
13179
+ },
13180
+ 11: function (node) {
13181
+ if (node = node.firstChild) {
13182
+ do {
13183
+ walk(node);
13184
+ } while (node = node.next);
13330
13185
  }
13331
- stack.length = pos;
13332
- }
13333
- };
13334
- var processText = function (value, raw) {
13335
- return text(restoreDataUris(value, base64Extract), raw);
13336
- };
13337
- var processComment = function (value) {
13338
- if (value === '') {
13339
- return;
13340
13186
  }
13341
- if (value.charAt(0) === '>') {
13342
- value = ' ' + value;
13343
- }
13344
- if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') {
13345
- value = ' ' + value;
13346
- }
13347
- comment(restoreDataUris(value, base64Extract));
13348
- };
13349
- var processAttr = function (value) {
13350
- return restoreDataUris(value, base64Extract);
13351
- };
13352
- var processMalformedComment = function (value, startIndex) {
13353
- var startTag = value || '';
13354
- var isBogus = !startsWith(startTag, '--');
13355
- var endIndex = findCommentEndIndex(html, isBogus, startIndex);
13356
- value = html.substr(startIndex, endIndex - startIndex);
13357
- processComment(isBogus ? startTag + value : value);
13358
- return endIndex + 1;
13359
13187
  };
13360
- var parseAttribute = function (tagName, name, value, val2, val3) {
13361
- name = name.toLowerCase();
13362
- value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || ''));
13363
- if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
13364
- var attrRule = validAttributesMap[name];
13365
- if (!attrRule && validAttributePatterns) {
13366
- var i_1 = validAttributePatterns.length;
13367
- while (i_1--) {
13368
- attrRule = validAttributePatterns[i_1];
13369
- if (attrRule.pattern.test(name)) {
13370
- break;
13188
+ writer.reset();
13189
+ var walk = function (node) {
13190
+ var handler = handlers[node.type];
13191
+ if (!handler) {
13192
+ var name_1 = node.name;
13193
+ var isEmpty = node.shortEnded;
13194
+ var attrs = node.attributes;
13195
+ if (validate && attrs && attrs.length > 1) {
13196
+ var sortedAttrs = [];
13197
+ sortedAttrs.map = {};
13198
+ var elementRule = schema.getElementRule(node.name);
13199
+ if (elementRule) {
13200
+ for (var i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
13201
+ var attrName = elementRule.attributesOrder[i];
13202
+ if (attrName in attrs.map) {
13203
+ var attrValue = attrs.map[attrName];
13204
+ sortedAttrs.map[attrName] = attrValue;
13205
+ sortedAttrs.push({
13206
+ name: attrName,
13207
+ value: attrValue
13208
+ });
13209
+ }
13371
13210
  }
13211
+ for (var i = 0, l = attrs.length; i < l; i++) {
13212
+ var attrName = attrs[i].name;
13213
+ if (!(attrName in sortedAttrs.map)) {
13214
+ var attrValue = attrs.map[attrName];
13215
+ sortedAttrs.map[attrName] = attrValue;
13216
+ sortedAttrs.push({
13217
+ name: attrName,
13218
+ value: attrValue
13219
+ });
13220
+ }
13221
+ }
13222
+ attrs = sortedAttrs;
13372
13223
  }
13373
- if (i_1 === -1) {
13374
- attrRule = null;
13375
- }
13376
- }
13377
- if (!attrRule) {
13378
- return;
13379
13224
  }
13380
- if (attrRule.validValues && !(value in attrRule.validValues)) {
13381
- return;
13225
+ writer.start(node.name, attrs, isEmpty);
13226
+ if (!isEmpty) {
13227
+ if (node = node.firstChild) {
13228
+ do {
13229
+ walk(node);
13230
+ } while (node = node.next);
13231
+ }
13232
+ writer.end(name_1);
13382
13233
  }
13234
+ } else {
13235
+ handler(node);
13383
13236
  }
13384
- var isNameOrId = name === 'name' || name === 'id';
13385
- if (isNameOrId && tagName in filteredClobberElements && (value in doc || value in form)) {
13386
- return;
13387
- }
13388
- if (filteredUrlAttrs[name] && !URI.isDomSafe(value, tagName, settings)) {
13389
- return;
13390
- }
13391
- if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
13392
- return;
13393
- }
13394
- attrList.map[name] = value;
13395
- attrList.push({
13396
- name: name,
13397
- value: value
13398
- });
13399
13237
  };
13400
- var tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)--!?>)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|' + '(?:!(--)?)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^\'">]+(?:"[^"]*"|\'[^\']*\'))*[^"\'>]*(?:"[^">]*|\'[^\'>]*)?|\\s*|\\/)>)' + ')', 'g');
13401
- var attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
13402
- var shortEndedElements = schema.getShortEndedElements();
13403
- var selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
13404
- var fillAttrsMap = schema.getBoolAttrs();
13405
- var validate = settings.validate;
13406
- var removeInternalElements = settings.remove_internals;
13407
- var fixSelfClosing = settings.fix_self_closing;
13408
- var specialElements = schema.getSpecialElements();
13409
- var processHtml = html + '>';
13410
- while (matches = tokenRegExp.exec(processHtml)) {
13411
- var matchText = matches[0];
13412
- if (index < matches.index) {
13413
- processText(decode(html.substr(index, matches.index - index)));
13414
- }
13415
- if (value = matches[7]) {
13416
- value = value.toLowerCase();
13417
- if (value.charAt(0) === ':') {
13418
- value = value.substr(1);
13419
- }
13420
- processEndTag(value);
13421
- } else if (value = matches[8]) {
13422
- if (matches.index + matchText.length > html.length) {
13423
- processText(decode(html.substr(matches.index)));
13424
- index = matches.index + matchText.length;
13425
- continue;
13426
- }
13427
- value = value.toLowerCase();
13428
- if (value.charAt(0) === ':') {
13429
- value = value.substr(1);
13430
- }
13431
- isShortEnded = value in shortEndedElements;
13432
- if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
13433
- processEndTag(value);
13434
- }
13435
- var bogusValue = checkBogusAttribute(attrRegExp, matches[9]);
13436
- if (bogusValue !== null) {
13437
- if (bogusValue === 'all') {
13438
- index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
13439
- tokenRegExp.lastIndex = index;
13440
- continue;
13441
- }
13442
- isValidElement = false;
13443
- }
13444
- if (!validate || (elementRule = schema.getElementRule(value))) {
13445
- isValidElement = true;
13446
- if (validate) {
13447
- validAttributesMap = elementRule.attributes;
13448
- validAttributePatterns = elementRule.attributePatterns;
13449
- }
13450
- if (attribsValue = matches[9]) {
13451
- isInternalElement = attribsValue.indexOf('data-mce-type') !== -1;
13452
- if (isInternalElement && removeInternalElements) {
13453
- isValidElement = false;
13454
- }
13455
- attrList = [];
13456
- attrList.map = {};
13457
- attribsValue.replace(attrRegExp, function (match, name, val, val2, val3) {
13458
- parseAttribute(value, name, val, val2, val3);
13459
- return '';
13460
- });
13461
- } else {
13462
- attrList = [];
13463
- attrList.map = {};
13464
- }
13465
- if (validate && !isInternalElement) {
13466
- attributesRequired = elementRule.attributesRequired;
13467
- attributesDefault = elementRule.attributesDefault;
13468
- attributesForced = elementRule.attributesForced;
13469
- anyAttributesRequired = elementRule.removeEmptyAttrs;
13470
- if (anyAttributesRequired && !attrList.length) {
13471
- isValidElement = false;
13472
- }
13473
- if (attributesForced) {
13474
- i = attributesForced.length;
13475
- while (i--) {
13476
- attr = attributesForced[i];
13477
- name = attr.name;
13478
- attrValue = attr.value;
13479
- if (attrValue === '{$uid}') {
13480
- attrValue = 'mce_' + idCount++;
13481
- }
13482
- attrList.map[name] = attrValue;
13483
- attrList.push({
13484
- name: name,
13485
- value: attrValue
13486
- });
13487
- }
13488
- }
13489
- if (attributesDefault) {
13490
- i = attributesDefault.length;
13491
- while (i--) {
13492
- attr = attributesDefault[i];
13493
- name = attr.name;
13494
- if (!(name in attrList.map)) {
13495
- attrValue = attr.value;
13496
- if (attrValue === '{$uid}') {
13497
- attrValue = 'mce_' + idCount++;
13498
- }
13499
- attrList.map[name] = attrValue;
13500
- attrList.push({
13501
- name: name,
13502
- value: attrValue
13503
- });
13504
- }
13505
- }
13506
- }
13507
- if (attributesRequired) {
13508
- i = attributesRequired.length;
13509
- while (i--) {
13510
- if (attributesRequired[i] in attrList.map) {
13511
- break;
13512
- }
13513
- }
13514
- if (i === -1) {
13515
- isValidElement = false;
13516
- }
13517
- }
13518
- if (attr = attrList.map['data-mce-bogus']) {
13519
- if (attr === 'all') {
13520
- index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
13521
- tokenRegExp.lastIndex = index;
13522
- continue;
13523
- }
13524
- isValidElement = false;
13525
- }
13526
- }
13527
- if (isValidElement) {
13528
- start(value, attrList, isShortEnded);
13529
- }
13530
- } else {
13531
- isValidElement = false;
13532
- }
13533
- if (endRegExp = specialElements[value]) {
13534
- endRegExp.lastIndex = index = matches.index + matchText.length;
13535
- if (matches = endRegExp.exec(html)) {
13536
- if (isValidElement) {
13537
- textData = html.substr(index, matches.index - index);
13538
- }
13539
- index = matches.index + matches[0].length;
13540
- } else {
13541
- textData = html.substr(index);
13542
- index = html.length;
13543
- }
13544
- if (isValidElement) {
13545
- if (textData.length > 0) {
13546
- processText(textData, true);
13547
- }
13548
- end(value);
13549
- }
13550
- tokenRegExp.lastIndex = index;
13551
- continue;
13552
- }
13553
- if (!isShortEnded) {
13554
- if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) {
13555
- stack.push({
13556
- name: value,
13557
- valid: isValidElement
13558
- });
13559
- } else if (isValidElement) {
13560
- end(value);
13561
- }
13562
- }
13563
- } else if (value = matches[1]) {
13564
- processComment(value);
13565
- } else if (value = matches[2]) {
13566
- var isValidCdataSection = parsingMode === 1 || settings.preserve_cdata || stack.length > 0 && schema.isValidChild(stack[stack.length - 1].name, '#cdata');
13567
- if (isValidCdataSection) {
13568
- cdata(value);
13569
- } else {
13570
- index = processMalformedComment('', matches.index + 2);
13571
- tokenRegExp.lastIndex = index;
13572
- continue;
13573
- }
13574
- } else if (value = matches[3]) {
13575
- doctype(value);
13576
- } else if ((value = matches[4]) || matchText === '<!') {
13577
- index = processMalformedComment(value, matches.index + matchText.length);
13578
- tokenRegExp.lastIndex = index;
13579
- continue;
13580
- } else if (value = matches[5]) {
13581
- if (parsingMode === 1) {
13582
- pi(value, matches[6]);
13583
- } else {
13584
- index = processMalformedComment('?', matches.index + 2);
13585
- tokenRegExp.lastIndex = index;
13586
- continue;
13587
- }
13588
- }
13589
- index = matches.index + matchText.length;
13590
- }
13591
- if (index < html.length) {
13592
- processText(decode(html.substr(index)));
13593
- }
13594
- for (i = stack.length - 1; i >= 0; i--) {
13595
- value = stack[i];
13596
- if (value.valid) {
13597
- end(value.name);
13598
- }
13599
- }
13600
- };
13601
- var parse = function (html, format) {
13602
- if (format === void 0) {
13603
- format = 'html';
13238
+ if (node.type === 1 && !settings.inner) {
13239
+ walk(node);
13240
+ } else {
13241
+ handlers[11](node);
13604
13242
  }
13605
- parseInternal(extractBase64DataUris(html), format);
13243
+ return writer.getContent();
13606
13244
  };
13607
- return { parse: parse };
13245
+ return { serialize: serialize };
13608
13246
  };
13609
- SaxParser.findEndTag = findMatchingEndTagIndex;
13610
13247
 
13611
- var trimHtml = function (tempAttrs, html) {
13612
- var trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi');
13613
- return html.replace(trimContentRegExp, '');
13248
+ var nonInheritableStyles = new Set();
13249
+ (function () {
13250
+ var nonInheritableStylesArr = [
13251
+ 'margin',
13252
+ 'margin-left',
13253
+ 'margin-right',
13254
+ 'margin-top',
13255
+ 'margin-bottom',
13256
+ 'padding',
13257
+ 'padding-left',
13258
+ 'padding-right',
13259
+ 'padding-top',
13260
+ 'padding-bottom',
13261
+ 'border',
13262
+ 'border-width',
13263
+ 'border-style',
13264
+ 'border-color',
13265
+ 'background',
13266
+ 'background-attachment',
13267
+ 'background-clip',
13268
+ 'background-color',
13269
+ 'background-image',
13270
+ 'background-origin',
13271
+ 'background-position',
13272
+ 'background-repeat',
13273
+ 'background-size',
13274
+ 'float',
13275
+ 'position',
13276
+ 'left',
13277
+ 'right',
13278
+ 'top',
13279
+ 'bottom',
13280
+ 'z-index',
13281
+ 'display',
13282
+ 'transform',
13283
+ 'width',
13284
+ 'max-width',
13285
+ 'min-width',
13286
+ 'height',
13287
+ 'max-height',
13288
+ 'min-height',
13289
+ 'overflow',
13290
+ 'overflow-x',
13291
+ 'overflow-y',
13292
+ 'text-overflow',
13293
+ 'vertical-align',
13294
+ 'transition',
13295
+ 'transition-delay',
13296
+ 'transition-duration',
13297
+ 'transition-property',
13298
+ 'transition-timing-function'
13299
+ ];
13300
+ each$k(nonInheritableStylesArr, function (style) {
13301
+ nonInheritableStyles.add(style);
13302
+ });
13303
+ }());
13304
+ var shorthandStyleProps = [
13305
+ 'font',
13306
+ 'text-decoration',
13307
+ 'text-emphasis'
13308
+ ];
13309
+ var getStyleProps = function (dom, node) {
13310
+ return keys(dom.parseStyle(dom.getAttrib(node, 'style')));
13614
13311
  };
13615
- var trimInternal = function (serializer, html) {
13616
- var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
13617
- var schema = serializer.schema;
13618
- var content = trimHtml(serializer.getTempAttrs(), html);
13619
- var shortEndedElements = schema.getShortEndedElements();
13620
- var matches;
13621
- while (matches = bogusAllRegExp.exec(content)) {
13622
- var index = bogusAllRegExp.lastIndex;
13623
- var matchLength = matches[0].length;
13624
- var endTagIndex = void 0;
13625
- if (shortEndedElements[matches[1]]) {
13626
- endTagIndex = index;
13627
- } else {
13628
- endTagIndex = SaxParser.findEndTag(schema, content, index);
13629
- }
13630
- content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
13631
- bogusAllRegExp.lastIndex = index - matchLength;
13632
- }
13633
- return trim$2(content);
13312
+ var isNonInheritableStyle = function (style) {
13313
+ return nonInheritableStyles.has(style);
13634
13314
  };
13635
- var trimExternal = trimInternal;
13636
-
13637
- var trimEmptyContents = function (editor, html) {
13638
- var blockName = getForcedRootBlock(editor);
13639
- var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>(&nbsp;|&#160;|\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
13640
- return html.replace(emptyRegExp, '');
13315
+ var hasInheritableStyles = function (dom, node) {
13316
+ return forall(getStyleProps(dom, node), function (style) {
13317
+ return !isNonInheritableStyle(style);
13318
+ });
13641
13319
  };
13642
- var setupArgs$3 = function (args, format) {
13643
- return __assign(__assign({}, args), {
13644
- format: format,
13645
- get: true,
13646
- getInner: true
13320
+ var getLonghandStyleProps = function (styles) {
13321
+ return filter$4(styles, function (style) {
13322
+ return exists(shorthandStyleProps, function (prop) {
13323
+ return startsWith(style, prop);
13324
+ });
13647
13325
  });
13648
13326
  };
13649
- var getContentFromBody = function (editor, args, format, body) {
13650
- var defaultedArgs = setupArgs$3(args, format);
13651
- var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeGetContent', defaultedArgs);
13652
- var content;
13653
- if (updatedArgs.format === 'raw') {
13654
- content = Tools.trim(trimExternal(editor.serializer, body.innerHTML));
13655
- } else if (updatedArgs.format === 'text') {
13656
- content = editor.dom.isEmpty(body) ? '' : trim$2(body.innerText || body.textContent);
13657
- } else if (updatedArgs.format === 'tree') {
13658
- content = editor.serializer.serialize(body, updatedArgs);
13659
- } else {
13660
- content = trimEmptyContents(editor, editor.serializer.serialize(body, updatedArgs));
13661
- }
13662
- if (!contains$3([
13663
- 'text',
13664
- 'tree'
13665
- ], updatedArgs.format) && !isWsPreserveElement(SugarElement.fromDom(body))) {
13666
- updatedArgs.content = Tools.trim(content);
13667
- } else {
13668
- updatedArgs.content = content;
13669
- }
13670
- if (updatedArgs.no_events) {
13671
- return updatedArgs.content;
13672
- } else {
13673
- return editor.fire('GetContent', updatedArgs).content;
13674
- }
13675
- };
13676
- var getContentInternal = function (editor, args, format) {
13677
- return Optional.from(editor.getBody()).fold(constant(args.format === 'tree' ? new AstNode('body', 11) : ''), function (body) {
13678
- return getContentFromBody(editor, args, format, body);
13679
- });
13680
- };
13681
-
13682
- var each$c = Tools.each;
13683
- var ElementUtils = function (dom) {
13684
- var compare = function (node1, node2) {
13685
- if (node1.nodeName !== node2.nodeName) {
13686
- return false;
13687
- }
13688
- var getAttribs = function (node) {
13689
- var attribs = {};
13690
- each$c(dom.getAttribs(node), function (attr) {
13691
- var name = attr.nodeName.toLowerCase();
13692
- if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
13693
- attribs[name] = dom.getAttrib(node, name);
13694
- }
13327
+ var hasStyleConflict = function (dom, node, parentNode) {
13328
+ var nodeStyleProps = getStyleProps(dom, node);
13329
+ var parentNodeStyleProps = getStyleProps(dom, parentNode);
13330
+ var valueMismatch = function (prop) {
13331
+ var nodeValue = dom.getStyle(node, prop);
13332
+ var parentValue = dom.getStyle(parentNode, prop);
13333
+ return isNotEmpty(nodeValue) && isNotEmpty(parentValue) && nodeValue !== parentValue;
13334
+ };
13335
+ return exists(nodeStyleProps, function (nodeStyleProp) {
13336
+ var propExists = function (props) {
13337
+ return exists(props, function (prop) {
13338
+ return prop === nodeStyleProp;
13695
13339
  });
13696
- return attribs;
13697
- };
13698
- var compareObjects = function (obj1, obj2) {
13699
- var value, name;
13700
- for (name in obj1) {
13701
- if (has$2(obj1, name)) {
13702
- value = obj2[name];
13703
- if (typeof value === 'undefined') {
13704
- return false;
13705
- }
13706
- if (obj1[name] !== value) {
13707
- return false;
13708
- }
13709
- delete obj2[name];
13710
- }
13711
- }
13712
- for (name in obj2) {
13713
- if (has$2(obj2, name)) {
13714
- return false;
13715
- }
13716
- }
13717
- return true;
13718
13340
  };
13719
- if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
13720
- return false;
13721
- }
13722
- if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
13723
- return false;
13341
+ if (!propExists(parentNodeStyleProps) && propExists(shorthandStyleProps)) {
13342
+ var longhandProps = getLonghandStyleProps(parentNodeStyleProps);
13343
+ return exists(longhandProps, valueMismatch);
13344
+ } else {
13345
+ return valueMismatch(nodeStyleProp);
13724
13346
  }
13725
- return !isBookmarkNode$1(node1) && !isBookmarkNode$1(node2);
13726
- };
13727
- return { compare: compare };
13347
+ });
13728
13348
  };
13729
13349
 
13730
- var makeMap$1 = Tools.makeMap;
13731
- var Writer = function (settings) {
13732
- var html = [];
13733
- settings = settings || {};
13734
- var indent = settings.indent;
13735
- var indentBefore = makeMap$1(settings.indent_before || '');
13736
- var indentAfter = makeMap$1(settings.indent_after || '');
13737
- var encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
13738
- var htmlOutput = settings.element_format === 'html';
13739
- return {
13740
- start: function (name, attrs, empty) {
13741
- var i, l, attr, value;
13742
- if (indent && indentBefore[name] && html.length > 0) {
13743
- value = html[html.length - 1];
13744
- if (value.length > 0 && value !== '\n') {
13745
- html.push('\n');
13746
- }
13747
- }
13748
- html.push('<', name);
13749
- if (attrs) {
13750
- for (i = 0, l = attrs.length; i < l; i++) {
13751
- attr = attrs[i];
13752
- html.push(' ', attr.name, '="', encode(attr.value, true), '"');
13753
- }
13754
- }
13755
- if (!empty || htmlOutput) {
13756
- html[html.length] = '>';
13757
- } else {
13758
- html[html.length] = ' />';
13759
- }
13760
- if (empty && indent && indentAfter[name] && html.length > 0) {
13761
- value = html[html.length - 1];
13762
- if (value.length > 0 && value !== '\n') {
13763
- html.push('\n');
13764
- }
13765
- }
13766
- },
13767
- end: function (name) {
13768
- var value;
13769
- html.push('</', name, '>');
13770
- if (indent && indentAfter[name] && html.length > 0) {
13771
- value = html[html.length - 1];
13772
- if (value.length > 0 && value !== '\n') {
13773
- html.push('\n');
13774
- }
13775
- }
13776
- },
13777
- text: function (text, raw) {
13778
- if (text.length > 0) {
13779
- html[html.length] = raw ? text : encode(text);
13780
- }
13781
- },
13782
- cdata: function (text) {
13783
- html.push('<![CDATA[', text, ']]>');
13784
- },
13785
- comment: function (text) {
13786
- html.push('<!--', text, '-->');
13787
- },
13788
- pi: function (name, text) {
13789
- if (text) {
13790
- html.push('<?', name, ' ', encode(text), '?>');
13791
- } else {
13792
- html.push('<?', name, '?>');
13793
- }
13794
- if (indent) {
13795
- html.push('\n');
13796
- }
13797
- },
13798
- doctype: function (text) {
13799
- html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
13800
- },
13801
- reset: function () {
13802
- html.length = 0;
13803
- },
13804
- getContent: function () {
13805
- return html.join('').replace(/\n$/, '');
13806
- }
13350
+ var isChar = function (forward, predicate, pos) {
13351
+ return Optional.from(pos.container()).filter(isText$7).exists(function (text) {
13352
+ var delta = forward ? 0 : -1;
13353
+ return predicate(text.data.charAt(pos.offset() + delta));
13354
+ });
13355
+ };
13356
+ var isBeforeSpace = curry(isChar, true, isWhiteSpace);
13357
+ var isAfterSpace = curry(isChar, false, isWhiteSpace);
13358
+ var isEmptyText = function (pos) {
13359
+ var container = pos.container();
13360
+ return isText$7(container) && (container.data.length === 0 || isZwsp(container.data) && BookmarkManager.isBookmarkNode(container.parentNode));
13361
+ };
13362
+ var matchesElementPosition = function (before, predicate) {
13363
+ return function (pos) {
13364
+ return Optional.from(getChildNodeAtRelativeOffset(before ? 0 : -1, pos)).filter(predicate).isSome();
13807
13365
  };
13808
13366
  };
13367
+ var isImageBlock = function (node) {
13368
+ return isImg(node) && get$5(SugarElement.fromDom(node), 'display') === 'block';
13369
+ };
13370
+ var isCefNode = function (node) {
13371
+ return isContentEditableFalse$b(node) && !isBogusAll$1(node);
13372
+ };
13373
+ var isBeforeImageBlock = matchesElementPosition(true, isImageBlock);
13374
+ var isAfterImageBlock = matchesElementPosition(false, isImageBlock);
13375
+ var isBeforeMedia = matchesElementPosition(true, isMedia$2);
13376
+ var isAfterMedia = matchesElementPosition(false, isMedia$2);
13377
+ var isBeforeTable = matchesElementPosition(true, isTable$3);
13378
+ var isAfterTable = matchesElementPosition(false, isTable$3);
13379
+ var isBeforeContentEditableFalse = matchesElementPosition(true, isCefNode);
13380
+ var isAfterContentEditableFalse = matchesElementPosition(false, isCefNode);
13809
13381
 
13810
- var HtmlSerializer = function (settings, schema) {
13811
- if (schema === void 0) {
13812
- schema = Schema();
13382
+ var getLastChildren = function (elm) {
13383
+ var children = [];
13384
+ var rawNode = elm.dom;
13385
+ while (rawNode) {
13386
+ children.push(SugarElement.fromDom(rawNode));
13387
+ rawNode = rawNode.lastChild;
13813
13388
  }
13814
- var writer = Writer(settings);
13815
- settings = settings || {};
13816
- settings.validate = 'validate' in settings ? settings.validate : true;
13817
- var serialize = function (node) {
13818
- var validate = settings.validate;
13819
- var handlers = {
13820
- 3: function (node) {
13821
- writer.text(node.value, node.raw);
13822
- },
13823
- 8: function (node) {
13824
- writer.comment(node.value);
13825
- },
13826
- 7: function (node) {
13827
- writer.pi(node.name, node.value);
13828
- },
13829
- 10: function (node) {
13830
- writer.doctype(node.value);
13831
- },
13832
- 4: function (node) {
13833
- writer.cdata(node.value);
13834
- },
13835
- 11: function (node) {
13836
- if (node = node.firstChild) {
13837
- do {
13838
- walk(node);
13839
- } while (node = node.next);
13840
- }
13841
- }
13842
- };
13843
- writer.reset();
13844
- var walk = function (node) {
13845
- var handler = handlers[node.type];
13846
- if (!handler) {
13847
- var name_1 = node.name;
13848
- var isEmpty = node.shortEnded;
13849
- var attrs = node.attributes;
13850
- if (validate && attrs && attrs.length > 1) {
13851
- var sortedAttrs = [];
13852
- sortedAttrs.map = {};
13853
- var elementRule = schema.getElementRule(node.name);
13854
- if (elementRule) {
13855
- for (var i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
13856
- var attrName = elementRule.attributesOrder[i];
13857
- if (attrName in attrs.map) {
13858
- var attrValue = attrs.map[attrName];
13859
- sortedAttrs.map[attrName] = attrValue;
13860
- sortedAttrs.push({
13861
- name: attrName,
13862
- value: attrValue
13863
- });
13864
- }
13865
- }
13866
- for (var i = 0, l = attrs.length; i < l; i++) {
13867
- var attrName = attrs[i].name;
13868
- if (!(attrName in sortedAttrs.map)) {
13869
- var attrValue = attrs.map[attrName];
13870
- sortedAttrs.map[attrName] = attrValue;
13871
- sortedAttrs.push({
13872
- name: attrName,
13873
- value: attrValue
13874
- });
13875
- }
13876
- }
13877
- attrs = sortedAttrs;
13878
- }
13879
- }
13880
- writer.start(node.name, attrs, isEmpty);
13881
- if (!isEmpty) {
13882
- if (node = node.firstChild) {
13883
- do {
13884
- walk(node);
13885
- } while (node = node.next);
13886
- }
13887
- writer.end(name_1);
13888
- }
13889
- } else {
13890
- handler(node);
13891
- }
13892
- };
13893
- if (node.type === 1 && !settings.inner) {
13894
- walk(node);
13895
- } else {
13896
- handlers[11](node);
13897
- }
13898
- return writer.getContent();
13899
- };
13900
- return { serialize: serialize };
13901
- };
13902
-
13903
- var nonInheritableStyles = new Set();
13904
- (function () {
13905
- var nonInheritableStylesArr = [
13906
- 'margin',
13907
- 'margin-left',
13908
- 'margin-right',
13909
- 'margin-top',
13910
- 'margin-bottom',
13911
- 'padding',
13912
- 'padding-left',
13913
- 'padding-right',
13914
- 'padding-top',
13915
- 'padding-bottom',
13916
- 'border',
13917
- 'border-width',
13918
- 'border-style',
13919
- 'border-color',
13920
- 'background',
13921
- 'background-attachment',
13922
- 'background-clip',
13923
- 'background-color',
13924
- 'background-image',
13925
- 'background-origin',
13926
- 'background-position',
13927
- 'background-repeat',
13928
- 'background-size',
13929
- 'float',
13930
- 'position',
13931
- 'left',
13932
- 'right',
13933
- 'top',
13934
- 'bottom',
13935
- 'z-index',
13936
- 'display',
13937
- 'transform',
13938
- 'width',
13939
- 'max-width',
13940
- 'min-width',
13941
- 'height',
13942
- 'max-height',
13943
- 'min-height',
13944
- 'overflow',
13945
- 'overflow-x',
13946
- 'overflow-y',
13947
- 'text-overflow',
13948
- 'vertical-align',
13949
- 'transition',
13950
- 'transition-delay',
13951
- 'transition-duration',
13952
- 'transition-property',
13953
- 'transition-timing-function'
13954
- ];
13955
- each$k(nonInheritableStylesArr, function (style) {
13956
- nonInheritableStyles.add(style);
13957
- });
13958
- }());
13959
- var shorthandStyleProps = [
13960
- 'font',
13961
- 'text-decoration',
13962
- 'text-emphasis'
13963
- ];
13964
- var getStyleProps = function (dom, node) {
13965
- return keys(dom.parseStyle(dom.getAttrib(node, 'style')));
13966
- };
13967
- var isNonInheritableStyle = function (style) {
13968
- return nonInheritableStyles.has(style);
13969
- };
13970
- var hasInheritableStyles = function (dom, node) {
13971
- return forall(getStyleProps(dom, node), function (style) {
13972
- return !isNonInheritableStyle(style);
13973
- });
13974
- };
13975
- var getLonghandStyleProps = function (styles) {
13976
- return filter$4(styles, function (style) {
13977
- return exists(shorthandStyleProps, function (prop) {
13978
- return startsWith(style, prop);
13979
- });
13980
- });
13981
- };
13982
- var hasStyleConflict = function (dom, node, parentNode) {
13983
- var nodeStyleProps = getStyleProps(dom, node);
13984
- var parentNodeStyleProps = getStyleProps(dom, parentNode);
13985
- var valueMismatch = function (prop) {
13986
- var nodeValue = dom.getStyle(node, prop);
13987
- var parentValue = dom.getStyle(parentNode, prop);
13988
- return isNotEmpty(nodeValue) && isNotEmpty(parentValue) && nodeValue !== parentValue;
13989
- };
13990
- return exists(nodeStyleProps, function (nodeStyleProp) {
13991
- var propExists = function (props) {
13992
- return exists(props, function (prop) {
13993
- return prop === nodeStyleProp;
13994
- });
13995
- };
13996
- if (!propExists(parentNodeStyleProps) && propExists(shorthandStyleProps)) {
13997
- var longhandProps = getLonghandStyleProps(parentNodeStyleProps);
13998
- return exists(longhandProps, valueMismatch);
13999
- } else {
14000
- return valueMismatch(nodeStyleProp);
14001
- }
14002
- });
14003
- };
14004
-
14005
- var isChar = function (forward, predicate, pos) {
14006
- return Optional.from(pos.container()).filter(isText$7).exists(function (text) {
14007
- var delta = forward ? 0 : -1;
14008
- return predicate(text.data.charAt(pos.offset() + delta));
14009
- });
14010
- };
14011
- var isBeforeSpace = curry(isChar, true, isWhiteSpace);
14012
- var isAfterSpace = curry(isChar, false, isWhiteSpace);
14013
- var isEmptyText = function (pos) {
14014
- var container = pos.container();
14015
- return isText$7(container) && (container.data.length === 0 || isZwsp(container.data) && BookmarkManager.isBookmarkNode(container.parentNode));
14016
- };
14017
- var matchesElementPosition = function (before, predicate) {
14018
- return function (pos) {
14019
- return Optional.from(getChildNodeAtRelativeOffset(before ? 0 : -1, pos)).filter(predicate).isSome();
14020
- };
14021
- };
14022
- var isImageBlock = function (node) {
14023
- return isImg(node) && get$5(SugarElement.fromDom(node), 'display') === 'block';
14024
- };
14025
- var isCefNode = function (node) {
14026
- return isContentEditableFalse$b(node) && !isBogusAll$1(node);
14027
- };
14028
- var isBeforeImageBlock = matchesElementPosition(true, isImageBlock);
14029
- var isAfterImageBlock = matchesElementPosition(false, isImageBlock);
14030
- var isBeforeMedia = matchesElementPosition(true, isMedia$2);
14031
- var isAfterMedia = matchesElementPosition(false, isMedia$2);
14032
- var isBeforeTable = matchesElementPosition(true, isTable$3);
14033
- var isAfterTable = matchesElementPosition(false, isTable$3);
14034
- var isBeforeContentEditableFalse = matchesElementPosition(true, isCefNode);
14035
- var isAfterContentEditableFalse = matchesElementPosition(false, isCefNode);
14036
-
14037
- var getLastChildren = function (elm) {
14038
- var children = [];
14039
- var rawNode = elm.dom;
14040
- while (rawNode) {
14041
- children.push(SugarElement.fromDom(rawNode));
14042
- rawNode = rawNode.lastChild;
14043
- }
14044
- return children;
14045
- };
14046
- var removeTrailingBr = function (elm) {
14047
- var allBrs = descendants(elm, 'br');
14048
- var brs = filter$4(getLastChildren(elm).slice(-1), isBr$4);
14049
- if (allBrs.length === brs.length) {
14050
- each$k(brs, remove$7);
14051
- }
14052
- };
14053
- var fillWithPaddingBr = function (elm) {
14054
- empty(elm);
14055
- append$1(elm, SugarElement.fromHtml('<br data-mce-bogus="1">'));
14056
- };
14057
- var trimBlockTrailingBr = function (elm) {
14058
- lastChild(elm).each(function (lastChild) {
14059
- prevSibling(lastChild).each(function (lastChildPrevSibling) {
14060
- if (isBlock$2(elm) && isBr$4(lastChild) && isBlock$2(lastChildPrevSibling)) {
14061
- remove$7(lastChild);
13389
+ return children;
13390
+ };
13391
+ var removeTrailingBr = function (elm) {
13392
+ var allBrs = descendants(elm, 'br');
13393
+ var brs = filter$4(getLastChildren(elm).slice(-1), isBr$4);
13394
+ if (allBrs.length === brs.length) {
13395
+ each$k(brs, remove$7);
13396
+ }
13397
+ };
13398
+ var fillWithPaddingBr = function (elm) {
13399
+ empty(elm);
13400
+ append$1(elm, SugarElement.fromHtml('<br data-mce-bogus="1">'));
13401
+ };
13402
+ var trimBlockTrailingBr = function (elm) {
13403
+ lastChild(elm).each(function (lastChild) {
13404
+ prevSibling(lastChild).each(function (lastChildPrevSibling) {
13405
+ if (isBlock$2(elm) && isBr$4(lastChild) && isBlock$2(lastChildPrevSibling)) {
13406
+ remove$7(lastChild);
14062
13407
  }
14063
13408
  });
14064
13409
  });
@@ -15202,6 +14547,9 @@
15202
14547
  return;
15203
14548
  }
15204
14549
  value = args.content;
14550
+ if (!details.preserve_zwsp) {
14551
+ value = trim$3(value);
14552
+ }
15205
14553
  if (value.indexOf('{$caret}') === -1) {
15206
14554
  value += '{$caret}';
15207
14555
  }
@@ -15363,6 +14711,7 @@
15363
14711
  }
15364
14712
  };
15365
14713
  var setContentString = function (editor, body, content, args) {
14714
+ content = trim$3(content);
15366
14715
  if (content.length === 0 || /^\s+$/.test(content)) {
15367
14716
  var padd = '<br data-mce-bogus="1">';
15368
14717
  if (body.nodeName === 'TABLE') {
@@ -15397,7 +14746,7 @@
15397
14746
  var setContentTree = function (editor, body, content, args) {
15398
14747
  filter$1(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content);
15399
14748
  var html = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(content);
15400
- args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html);
14749
+ args.content = trim$3(isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html));
15401
14750
  setEditorHtml(editor, args.content, args.no_selection);
15402
14751
  if (!args.no_events) {
15403
14752
  editor.fire('SetContent', args);
@@ -15868,7 +15217,7 @@
15868
15217
 
15869
15218
  var postProcessHooks = {};
15870
15219
  var filter = filter$2;
15871
- var each$b = each$i;
15220
+ var each$c = each$i;
15872
15221
  var addPostProcessHook = function (name, hook) {
15873
15222
  var hooks = postProcessHooks[name];
15874
15223
  if (!hooks) {
@@ -15877,7 +15226,7 @@
15877
15226
  postProcessHooks[name].push(hook);
15878
15227
  };
15879
15228
  var postProcess$1 = function (name, editor) {
15880
- each$b(postProcessHooks[name], function (hook) {
15229
+ each$c(postProcessHooks[name], function (hook) {
15881
15230
  hook(editor);
15882
15231
  });
15883
15232
  };
@@ -15894,13 +15243,13 @@
15894
15243
  var isPre = matchNodeNames(['pre']);
15895
15244
  if (!rng.collapsed) {
15896
15245
  blocks = editor.selection.getSelectedBlocks();
15897
- each$b(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
15246
+ each$c(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
15898
15247
  joinPre(pre.previousSibling, pre);
15899
15248
  });
15900
15249
  }
15901
15250
  });
15902
15251
 
15903
- var each$a = Tools.each;
15252
+ var each$b = Tools.each;
15904
15253
  var isElementNode$1 = function (node) {
15905
15254
  return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
15906
15255
  };
@@ -15944,9 +15293,9 @@
15944
15293
  var clearChildStyles = function (dom, format, node) {
15945
15294
  if (format.clear_child_styles) {
15946
15295
  var selector = format.links ? '*:not(a)' : '*';
15947
- each$a(dom.select(selector, node), function (node) {
15296
+ each$b(dom.select(selector, node), function (node) {
15948
15297
  if (isElementNode$1(node)) {
15949
- each$a(format.styles, function (value, name) {
15298
+ each$b(format.styles, function (value, name) {
15950
15299
  dom.setStyle(node, name, '');
15951
15300
  });
15952
15301
  }
@@ -15954,7 +15303,7 @@
15954
15303
  }
15955
15304
  };
15956
15305
  var processChildElements = function (node, filter, process) {
15957
- each$a(node.childNodes, function (node) {
15306
+ each$b(node.childNodes, function (node) {
15958
15307
  if (isElementNode$1(node)) {
15959
15308
  if (filter(node)) {
15960
15309
  process(node);
@@ -15991,7 +15340,7 @@
15991
15340
  { removed: [] }
15992
15341
  ]);
15993
15342
  var MCE_ATTR_RE = /^(src|href|style)$/;
15994
- var each$9 = Tools.each;
15343
+ var each$a = Tools.each;
15995
15344
  var isEq$2 = isEq$5;
15996
15345
  var isTableCellOrRow = function (node) {
15997
15346
  return /^(TR|TH|TD)$/.test(node.nodeName);
@@ -16125,7 +15474,7 @@
16125
15474
  }
16126
15475
  }
16127
15476
  if (format.remove !== 'all') {
16128
- each$9(format.styles, function (value, name) {
15477
+ each$a(format.styles, function (value, name) {
16129
15478
  value = normalizeStyleValue(dom, replaceVars(value, vars), name + '');
16130
15479
  if (isNumber(name)) {
16131
15480
  name = value;
@@ -16140,7 +15489,7 @@
16140
15489
  elm.removeAttribute('style');
16141
15490
  elm.removeAttribute('data-mce-style');
16142
15491
  }
16143
- each$9(format.attributes, function (value, name) {
15492
+ each$a(format.attributes, function (value, name) {
16144
15493
  var valueOut;
16145
15494
  value = replaceVars(value, vars);
16146
15495
  if (isNumber(name)) {
@@ -16177,7 +15526,7 @@
16177
15526
  elm.removeAttribute(name);
16178
15527
  }
16179
15528
  });
16180
- each$9(format.classes, function (value) {
15529
+ each$a(format.classes, function (value) {
16181
15530
  value = replaceVars(value, vars);
16182
15531
  if (!compareNode || dom.hasClass(compareNode, value)) {
16183
15532
  dom.removeClass(elm, value);
@@ -16287,8 +15636,11 @@
16287
15636
  var children = from(node.childNodes);
16288
15637
  if (contentEditable && !hasContentEditableState) {
16289
15638
  var removed = removeNodeFormat(node);
15639
+ var currentNodeMatches = removed || exists(formatList, function (f) {
15640
+ return matchName$1(dom, node, f);
15641
+ });
16290
15642
  var parentNode = node.parentNode;
16291
- if (!removed && isNonNullable(parentNode) && shouldExpandToSelector(format)) {
15643
+ if (!currentNodeMatches && isNonNullable(parentNode) && shouldExpandToSelector(format)) {
16292
15644
  removeNodeFormat(parentNode);
16293
15645
  }
16294
15646
  }
@@ -16430,7 +15782,7 @@
16430
15782
  fireFormatRemove(ed, name, node, vars);
16431
15783
  };
16432
15784
 
16433
- var each$8 = Tools.each;
15785
+ var each$9 = Tools.each;
16434
15786
  var mergeTextDecorationsAndColor = function (dom, format, vars, node) {
16435
15787
  var processTextDecorationsAndColor = function (n) {
16436
15788
  if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) {
@@ -16459,9 +15811,9 @@
16459
15811
  }
16460
15812
  };
16461
15813
  var mergeWithChildren = function (editor, formatList, vars, node) {
16462
- each$8(formatList, function (format) {
15814
+ each$9(formatList, function (format) {
16463
15815
  if (isInlineFormat(format)) {
16464
- each$8(editor.dom.select(format.inline, node), function (child) {
15816
+ each$9(editor.dom.select(format.inline, node), function (child) {
16465
15817
  if (!isElementNode$1(child)) {
16466
15818
  return;
16467
15819
  }
@@ -16487,23 +15839,13 @@
16487
15839
  }
16488
15840
  };
16489
15841
 
16490
- var each$7 = Tools.each;
15842
+ var each$8 = Tools.each;
16491
15843
  var isElementNode = function (node) {
16492
15844
  return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
16493
15845
  };
16494
15846
  var canFormatBR = function (editor, format, node, parentName) {
16495
15847
  if (canFormatEmptyLines(editor) && isInlineFormat(format)) {
16496
- var validBRParentElements = __assign(__assign({}, editor.schema.getTextBlockElements()), {
16497
- td: {},
16498
- th: {},
16499
- li: {},
16500
- dt: {},
16501
- dd: {},
16502
- figcaption: {},
16503
- caption: {},
16504
- details: {},
16505
- summary: {}
16506
- });
15848
+ var validBRParentElements = getTextRootBlockElements(editor.schema);
16507
15849
  var hasCaretNodeSibling = sibling(SugarElement.fromDom(node), function (sibling) {
16508
15850
  return isCaretNode(sibling.dom);
16509
15851
  });
@@ -16525,7 +15867,7 @@
16525
15867
  if (isFunction(fmt.onformat)) {
16526
15868
  fmt.onformat(elm, fmt, vars, node);
16527
15869
  }
16528
- each$7(fmt.styles, function (value, name) {
15870
+ each$8(fmt.styles, function (value, name) {
16529
15871
  dom.setStyle(elm, name, replaceVars(value, vars));
16530
15872
  });
16531
15873
  if (fmt.styles) {
@@ -16534,10 +15876,10 @@
16534
15876
  dom.setAttrib(elm, 'data-mce-style', styleVal);
16535
15877
  }
16536
15878
  }
16537
- each$7(fmt.attributes, function (value, name) {
15879
+ each$8(fmt.attributes, function (value, name) {
16538
15880
  dom.setAttrib(elm, name, replaceVars(value, vars));
16539
15881
  });
16540
- each$7(fmt.classes, function (value) {
15882
+ each$8(fmt.classes, function (value) {
16541
15883
  value = replaceVars(value, vars);
16542
15884
  if (!dom.hasClass(elm, value)) {
16543
15885
  dom.addClass(elm, value);
@@ -16546,7 +15888,7 @@
16546
15888
  };
16547
15889
  var applyNodeStyle = function (formatList, node) {
16548
15890
  var found = false;
16549
- each$7(formatList, function (format) {
15891
+ each$8(formatList, function (format) {
16550
15892
  if (!isSelectorFormat(format)) {
16551
15893
  return false;
16552
15894
  }
@@ -17113,7 +16455,7 @@
17113
16455
  return index >= 0 && index < text.length && isWhiteSpace(text.charAt(index));
17114
16456
  };
17115
16457
  var getInnerText = function (bin, shouldTrim) {
17116
- var text = trim$2(bin.innerText);
16458
+ var text = trim$3(bin.innerText);
17117
16459
  return shouldTrim ? trimLeadingCollapsibleText(text) : text;
17118
16460
  };
17119
16461
  var getContextNodeName = function (parentBlockOpt) {
@@ -17132,7 +16474,7 @@
17132
16474
  'style': 'overflow: hidden; opacity: 0;'
17133
16475
  }, rng.cloneContents());
17134
16476
  var text = getInnerText(bin, shouldTrimSpaces);
17135
- var nonRenderedText = trim$2(bin.textContent);
16477
+ var nonRenderedText = trim$3(bin.textContent);
17136
16478
  editor.dom.remove(bin);
17137
16479
  if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) {
17138
16480
  var parentBlock = parentBlockOpt.getOr(body);
@@ -17359,8 +16701,8 @@
17359
16701
  }
17360
16702
  });
17361
16703
  };
17362
- var read$2 = function (elm) {
17363
- return filter$4(map$3(from(elm.childNodes), getOuterHtml), function (item) {
16704
+ var read$2 = function (elm, trimZwsp) {
16705
+ return filter$4(map$3(from(elm.childNodes), trimZwsp ? compose(trim$3, getOuterHtml) : getOuterHtml), function (item) {
17364
16706
  return item.length > 0;
17365
16707
  });
17366
16708
  };
@@ -17370,11 +16712,11 @@
17370
16712
  return elm;
17371
16713
  };
17372
16714
 
17373
- var lazyTempDocument = cached(function () {
16715
+ var lazyTempDocument$1 = cached(function () {
17374
16716
  return document.implementation.createHTMLDocument('undo');
17375
16717
  });
17376
- var hasIframes = function (html) {
17377
- return html.indexOf('</iframe>') !== -1;
16718
+ var hasIframes = function (body) {
16719
+ return body.querySelector('iframe') !== null;
17378
16720
  };
17379
16721
  var createFragmentedLevel = function (fragments) {
17380
16722
  return {
@@ -17395,13 +16737,9 @@
17395
16737
  };
17396
16738
  };
17397
16739
  var createFromEditor = function (editor) {
17398
- var fragments = read$2(editor.getBody());
17399
- var trimmedFragments = bind(fragments, function (html) {
17400
- var trimmed = trimInternal(editor.serializer, html);
17401
- return trimmed.length > 0 ? [trimmed] : [];
17402
- });
17403
- var content = trimmedFragments.join('');
17404
- return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content);
16740
+ var tempAttrs = editor.serializer.getTempAttrs();
16741
+ var body = trim$1(editor.getBody(), tempAttrs);
16742
+ return hasIframes(body) ? createFragmentedLevel(read$2(body, true)) : createCompleteLevel(trim$3(body.innerHTML));
17405
16743
  };
17406
16744
  var applyToEditor = function (editor, level, before) {
17407
16745
  var bookmark = before ? level.beforeBookmark : level.bookmark;
@@ -17419,7 +16757,7 @@
17419
16757
  return level.type === 'fragmented' ? level.fragments.join('') : level.content;
17420
16758
  };
17421
16759
  var getCleanLevelContent = function (level) {
17422
- var elm = SugarElement.fromTag('body', lazyTempDocument());
16760
+ var elm = SugarElement.fromTag('body', lazyTempDocument$1());
17423
16761
  set(elm, getLevelContent(level));
17424
16762
  each$k(descendants(elm, '*[data-mce-bogus]'), unwrap);
17425
16763
  return get$3(elm);
@@ -18487,7 +17825,7 @@
18487
17825
  }
18488
17826
  });
18489
17827
  };
18490
- var parseDataUri = function (uri) {
17828
+ var parseDataUri$1 = function (uri) {
18491
17829
  var type;
18492
17830
  var uriParts = decodeURIComponent(uri).split(',');
18493
17831
  var matches = /data:([^;]+)/.exec(uriParts[0]);
@@ -18514,7 +17852,7 @@
18514
17852
  };
18515
17853
  var dataUriToBlob = function (uri) {
18516
17854
  return new promiseObj(function (resolve) {
18517
- var _a = parseDataUri(uri), type = _a.type, data = _a.data;
17855
+ var _a = parseDataUri$1(uri), type = _a.type, data = _a.data;
18518
17856
  buildBlob(type, data).fold(function () {
18519
17857
  return resolve(new Blob([]));
18520
17858
  }, resolve);
@@ -18555,7 +17893,7 @@
18555
17893
  } else {
18556
17894
  uriToBlob(img.src).then(function (blob) {
18557
17895
  blobToDataUri(blob).then(function (dataUri) {
18558
- base64 = parseDataUri(dataUri).data;
17896
+ base64 = parseDataUri$1(dataUri).data;
18559
17897
  blobInfo = blobCache.create(uniqueId(), blob, base64);
18560
17898
  blobCache.add(blobInfo);
18561
17899
  resolve({
@@ -18569,7 +17907,7 @@
18569
17907
  }
18570
17908
  return;
18571
17909
  }
18572
- var _a = parseDataUri(img.src), data = _a.data, type = _a.type;
17910
+ var _a = parseDataUri$1(img.src), data = _a.data, type = _a.type;
18573
17911
  base64 = data;
18574
17912
  blobInfo = blobCache.getByData(base64, type);
18575
17913
  if (blobInfo) {
@@ -18652,21 +17990,76 @@
18652
17990
  return { findAll: findAll };
18653
17991
  };
18654
17992
 
18655
- var paddEmptyNode = function (settings, args, blockElements, node) {
18656
- var brPreferred = settings.padd_empty_with_br || args.insert;
18657
- if (brPreferred && blockElements[node.name]) {
18658
- node.empty().append(new AstNode('br', 1)).shortEnded = true;
18659
- } else {
18660
- node.empty().append(new AstNode('#text', 3)).value = nbsp;
17993
+ var extractBase64DataUris = function (html) {
17994
+ var dataImageUri = /data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi;
17995
+ var chunks = [];
17996
+ var uris = {};
17997
+ var prefix = generate('img');
17998
+ var matches;
17999
+ var index = 0;
18000
+ var count = 0;
18001
+ while (matches = dataImageUri.exec(html)) {
18002
+ var uri = matches[0];
18003
+ var imageId = prefix + '_' + count++;
18004
+ uris[imageId] = uri;
18005
+ if (index < matches.index) {
18006
+ chunks.push(html.substr(index, matches.index - index));
18007
+ }
18008
+ chunks.push(imageId);
18009
+ index = matches.index + uri.length;
18661
18010
  }
18662
- };
18663
- var isPaddedWithNbsp = function (node) {
18664
- return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp;
18665
- };
18666
- var hasOnlyChild = function (node, name) {
18667
- return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name;
18668
- };
18669
- var isPadded = function (schema, node) {
18011
+ var re = new RegExp(prefix + '_[0-9]+', 'g');
18012
+ if (index === 0) {
18013
+ return {
18014
+ prefix: prefix,
18015
+ uris: uris,
18016
+ html: html,
18017
+ re: re
18018
+ };
18019
+ } else {
18020
+ if (index < html.length) {
18021
+ chunks.push(html.substr(index));
18022
+ }
18023
+ return {
18024
+ prefix: prefix,
18025
+ uris: uris,
18026
+ html: chunks.join(''),
18027
+ re: re
18028
+ };
18029
+ }
18030
+ };
18031
+ var restoreDataUris = function (html, result) {
18032
+ return html.replace(result.re, function (imageId) {
18033
+ return get$9(result.uris, imageId).getOr(imageId);
18034
+ });
18035
+ };
18036
+ var parseDataUri = function (uri) {
18037
+ var matches = /data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(uri);
18038
+ if (matches) {
18039
+ return Optional.some({
18040
+ type: matches[1],
18041
+ data: decodeURIComponent(matches[2])
18042
+ });
18043
+ } else {
18044
+ return Optional.none();
18045
+ }
18046
+ };
18047
+
18048
+ var paddEmptyNode = function (settings, args, blockElements, node) {
18049
+ var brPreferred = settings.padd_empty_with_br || args.insert;
18050
+ if (brPreferred && blockElements[node.name]) {
18051
+ node.empty().append(new AstNode('br', 1)).shortEnded = true;
18052
+ } else {
18053
+ node.empty().append(new AstNode('#text', 3)).value = nbsp;
18054
+ }
18055
+ };
18056
+ var isPaddedWithNbsp = function (node) {
18057
+ return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp;
18058
+ };
18059
+ var hasOnlyChild = function (node, name) {
18060
+ return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name;
18061
+ };
18062
+ var isPadded = function (schema, node) {
18670
18063
  var rule = schema.getElementRule(node.name);
18671
18064
  return rule && rule.paddEmpty;
18672
18065
  };
@@ -18704,7 +18097,7 @@
18704
18097
  if (isInternalImageSource(img) || isBogusImage(img)) {
18705
18098
  return;
18706
18099
  }
18707
- parseDataUri$1(inputSrc).filter(function () {
18100
+ parseDataUri(inputSrc).filter(function () {
18708
18101
  return isValidDataImg(img, settings);
18709
18102
  }).bind(function (_a) {
18710
18103
  var type = _a.type, data = _a.data;
@@ -18749,136 +18142,823 @@
18749
18142
  if (prevName === 'br') {
18750
18143
  node = null;
18751
18144
  }
18752
- break;
18145
+ break;
18146
+ }
18147
+ prev = prev.prev;
18148
+ }
18149
+ if (node) {
18150
+ node.remove();
18151
+ if (isEmpty(schema, nonEmptyElements, whiteSpaceElements, parent)) {
18152
+ elementRule = schema.getElementRule(parent.name);
18153
+ if (elementRule) {
18154
+ if (elementRule.removeEmpty) {
18155
+ parent.remove();
18156
+ } else if (elementRule.paddEmpty) {
18157
+ paddEmptyNode(settings, args, blockElements, parent);
18158
+ }
18159
+ }
18160
+ }
18161
+ }
18162
+ } else {
18163
+ lastParent = node;
18164
+ while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
18165
+ lastParent = parent;
18166
+ if (blockElements[parent.name]) {
18167
+ break;
18168
+ }
18169
+ parent = parent.parent;
18170
+ }
18171
+ if (lastParent === parent && settings.padd_empty_with_br !== true) {
18172
+ textNode = new AstNode('#text', 3);
18173
+ textNode.value = nbsp;
18174
+ node.replace(textNode);
18175
+ }
18176
+ }
18177
+ }
18178
+ });
18179
+ }
18180
+ parser.addAttributeFilter('href', function (nodes) {
18181
+ var i = nodes.length;
18182
+ var appendRel = function (rel) {
18183
+ var parts = rel.split(' ').filter(function (p) {
18184
+ return p.length > 0;
18185
+ });
18186
+ return parts.concat(['noopener']).sort().join(' ');
18187
+ };
18188
+ var addNoOpener = function (rel) {
18189
+ var newRel = rel ? Tools.trim(rel) : '';
18190
+ if (!/\b(noopener)\b/g.test(newRel)) {
18191
+ return appendRel(newRel);
18192
+ } else {
18193
+ return newRel;
18194
+ }
18195
+ };
18196
+ if (!settings.allow_unsafe_link_target) {
18197
+ while (i--) {
18198
+ var node = nodes[i];
18199
+ if (node.name === 'a' && node.attr('target') === '_blank') {
18200
+ node.attr('rel', addNoOpener(node.attr('rel')));
18201
+ }
18202
+ }
18203
+ }
18204
+ });
18205
+ if (!settings.allow_html_in_named_anchor) {
18206
+ parser.addAttributeFilter('id,name', function (nodes) {
18207
+ var i = nodes.length, sibling, prevSibling, parent, node;
18208
+ while (i--) {
18209
+ node = nodes[i];
18210
+ if (node.name === 'a' && node.firstChild && !node.attr('href')) {
18211
+ parent = node.parent;
18212
+ sibling = node.lastChild;
18213
+ do {
18214
+ prevSibling = sibling.prev;
18215
+ parent.insert(sibling, node);
18216
+ sibling = prevSibling;
18217
+ } while (sibling);
18218
+ }
18219
+ }
18220
+ });
18221
+ }
18222
+ if (settings.fix_list_elements) {
18223
+ parser.addNodeFilter('ul,ol', function (nodes) {
18224
+ var i = nodes.length, node, parentNode;
18225
+ while (i--) {
18226
+ node = nodes[i];
18227
+ parentNode = node.parent;
18228
+ if (parentNode.name === 'ul' || parentNode.name === 'ol') {
18229
+ if (node.prev && node.prev.name === 'li') {
18230
+ node.prev.append(node);
18231
+ } else {
18232
+ var li = new AstNode('li', 1);
18233
+ li.attr('style', 'list-style-type: none');
18234
+ node.wrap(li);
18235
+ }
18236
+ }
18237
+ }
18238
+ });
18239
+ }
18240
+ if (settings.validate && schema.getValidClasses()) {
18241
+ parser.addAttributeFilter('class', function (nodes) {
18242
+ var validClasses = schema.getValidClasses();
18243
+ var i = nodes.length;
18244
+ while (i--) {
18245
+ var node = nodes[i];
18246
+ var classList = node.attr('class').split(' ');
18247
+ var classValue = '';
18248
+ for (var ci = 0; ci < classList.length; ci++) {
18249
+ var className = classList[ci];
18250
+ var valid = false;
18251
+ var validClassesMap = validClasses['*'];
18252
+ if (validClassesMap && validClassesMap[className]) {
18253
+ valid = true;
18254
+ }
18255
+ validClassesMap = validClasses[node.name];
18256
+ if (!valid && validClassesMap && validClassesMap[className]) {
18257
+ valid = true;
18258
+ }
18259
+ if (valid) {
18260
+ if (classValue) {
18261
+ classValue += ' ';
18262
+ }
18263
+ classValue += className;
18264
+ }
18265
+ }
18266
+ if (!classValue.length) {
18267
+ classValue = null;
18268
+ }
18269
+ node.attr('class', classValue);
18270
+ }
18271
+ });
18272
+ }
18273
+ registerBase64ImageFilter(parser, settings);
18274
+ };
18275
+
18276
+ var each$7 = Tools.each, trim = Tools.trim;
18277
+ var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
18278
+ var DEFAULT_PORTS = {
18279
+ ftp: 21,
18280
+ http: 80,
18281
+ https: 443,
18282
+ mailto: 25
18283
+ };
18284
+ var safeSvgDataUrlElements = [
18285
+ 'img',
18286
+ 'video'
18287
+ ];
18288
+ var blockSvgDataUris = function (allowSvgDataUrls, tagName) {
18289
+ if (isNonNullable(allowSvgDataUrls)) {
18290
+ return !allowSvgDataUrls;
18291
+ } else {
18292
+ return isNonNullable(tagName) ? !contains$3(safeSvgDataUrlElements, tagName) : true;
18293
+ }
18294
+ };
18295
+ var isInvalidUri = function (settings, uri, tagName) {
18296
+ if (settings.allow_html_data_urls) {
18297
+ return false;
18298
+ } else if (/^data:image\//i.test(uri)) {
18299
+ return blockSvgDataUris(settings.allow_svg_data_urls, tagName) && /^data:image\/svg\+xml/i.test(uri);
18300
+ } else {
18301
+ return /^data:/i.test(uri);
18302
+ }
18303
+ };
18304
+ var URI = function () {
18305
+ function URI(url, settings) {
18306
+ url = trim(url);
18307
+ this.settings = settings || {};
18308
+ var baseUri = this.settings.base_uri;
18309
+ var self = this;
18310
+ if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
18311
+ self.source = url;
18312
+ return;
18313
+ }
18314
+ var isProtocolRelative = url.indexOf('//') === 0;
18315
+ if (url.indexOf('/') === 0 && !isProtocolRelative) {
18316
+ url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
18317
+ }
18318
+ if (!/^[\w\-]*:?\/\//.test(url)) {
18319
+ var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
18320
+ if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
18321
+ url = '//mce_host' + self.toAbsPath(baseUrl, url);
18322
+ } else {
18323
+ var match = /([^#?]*)([#?]?.*)/.exec(url);
18324
+ url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
18325
+ }
18326
+ }
18327
+ url = url.replace(/@@/g, '(mce_at)');
18328
+ var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
18329
+ each$7(queryParts, function (v, i) {
18330
+ var part = urlMatch[i];
18331
+ if (part) {
18332
+ part = part.replace(/\(mce_at\)/g, '@@');
18333
+ }
18334
+ self[v] = part;
18335
+ });
18336
+ if (baseUri) {
18337
+ if (!self.protocol) {
18338
+ self.protocol = baseUri.protocol;
18339
+ }
18340
+ if (!self.userInfo) {
18341
+ self.userInfo = baseUri.userInfo;
18342
+ }
18343
+ if (!self.port && self.host === 'mce_host') {
18344
+ self.port = baseUri.port;
18345
+ }
18346
+ if (!self.host || self.host === 'mce_host') {
18347
+ self.host = baseUri.host;
18348
+ }
18349
+ self.source = '';
18350
+ }
18351
+ if (isProtocolRelative) {
18352
+ self.protocol = '';
18353
+ }
18354
+ }
18355
+ URI.parseDataUri = function (uri) {
18356
+ var type;
18357
+ var uriComponents = decodeURIComponent(uri).split(',');
18358
+ var matches = /data:([^;]+)/.exec(uriComponents[0]);
18359
+ if (matches) {
18360
+ type = matches[1];
18361
+ }
18362
+ return {
18363
+ type: type,
18364
+ data: uriComponents[1]
18365
+ };
18366
+ };
18367
+ URI.isDomSafe = function (uri, context, options) {
18368
+ if (options === void 0) {
18369
+ options = {};
18370
+ }
18371
+ if (options.allow_script_urls) {
18372
+ return true;
18373
+ } else {
18374
+ var decodedUri = Entities.decode(uri).replace(/[\s\u0000-\u001F]+/g, '');
18375
+ try {
18376
+ decodedUri = decodeURIComponent(decodedUri);
18377
+ } catch (ex) {
18378
+ decodedUri = unescape(decodedUri);
18379
+ }
18380
+ if (/((java|vb)script|mhtml):/i.test(decodedUri)) {
18381
+ return false;
18382
+ }
18383
+ return !isInvalidUri(options, decodedUri, context);
18384
+ }
18385
+ };
18386
+ URI.getDocumentBaseUrl = function (loc) {
18387
+ var baseUrl;
18388
+ if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
18389
+ baseUrl = loc.href;
18390
+ } else {
18391
+ baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
18392
+ }
18393
+ if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
18394
+ baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
18395
+ if (!/[\/\\]$/.test(baseUrl)) {
18396
+ baseUrl += '/';
18397
+ }
18398
+ }
18399
+ return baseUrl;
18400
+ };
18401
+ URI.prototype.setPath = function (path) {
18402
+ var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
18403
+ this.path = pathMatch[0];
18404
+ this.directory = pathMatch[1];
18405
+ this.file = pathMatch[2];
18406
+ this.source = '';
18407
+ this.getURI();
18408
+ };
18409
+ URI.prototype.toRelative = function (uri) {
18410
+ var output;
18411
+ if (uri === './') {
18412
+ return uri;
18413
+ }
18414
+ var relativeUri = new URI(uri, { base_uri: this });
18415
+ if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
18416
+ return relativeUri.getURI();
18417
+ }
18418
+ var tu = this.getURI(), uu = relativeUri.getURI();
18419
+ if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
18420
+ return tu;
18421
+ }
18422
+ output = this.toRelPath(this.path, relativeUri.path);
18423
+ if (relativeUri.query) {
18424
+ output += '?' + relativeUri.query;
18425
+ }
18426
+ if (relativeUri.anchor) {
18427
+ output += '#' + relativeUri.anchor;
18428
+ }
18429
+ return output;
18430
+ };
18431
+ URI.prototype.toAbsolute = function (uri, noHost) {
18432
+ var absoluteUri = new URI(uri, { base_uri: this });
18433
+ return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
18434
+ };
18435
+ URI.prototype.isSameOrigin = function (uri) {
18436
+ if (this.host == uri.host && this.protocol == uri.protocol) {
18437
+ if (this.port == uri.port) {
18438
+ return true;
18439
+ }
18440
+ var defaultPort = DEFAULT_PORTS[this.protocol];
18441
+ if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
18442
+ return true;
18443
+ }
18444
+ }
18445
+ return false;
18446
+ };
18447
+ URI.prototype.toRelPath = function (base, path) {
18448
+ var breakPoint = 0, out = '', i, l;
18449
+ var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
18450
+ var items = path.split('/');
18451
+ if (normalizedBase.length >= items.length) {
18452
+ for (i = 0, l = normalizedBase.length; i < l; i++) {
18453
+ if (i >= items.length || normalizedBase[i] !== items[i]) {
18454
+ breakPoint = i + 1;
18455
+ break;
18456
+ }
18457
+ }
18458
+ }
18459
+ if (normalizedBase.length < items.length) {
18460
+ for (i = 0, l = items.length; i < l; i++) {
18461
+ if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
18462
+ breakPoint = i + 1;
18463
+ break;
18464
+ }
18465
+ }
18466
+ }
18467
+ if (breakPoint === 1) {
18468
+ return path;
18469
+ }
18470
+ for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
18471
+ out += '../';
18472
+ }
18473
+ for (i = breakPoint - 1, l = items.length; i < l; i++) {
18474
+ if (i !== breakPoint - 1) {
18475
+ out += '/' + items[i];
18476
+ } else {
18477
+ out += items[i];
18478
+ }
18479
+ }
18480
+ return out;
18481
+ };
18482
+ URI.prototype.toAbsPath = function (base, path) {
18483
+ var i, nb = 0, o = [], outPath;
18484
+ var tr = /\/$/.test(path) ? '/' : '';
18485
+ var normalizedBase = base.split('/');
18486
+ var normalizedPath = path.split('/');
18487
+ each$7(normalizedBase, function (k) {
18488
+ if (k) {
18489
+ o.push(k);
18490
+ }
18491
+ });
18492
+ normalizedBase = o;
18493
+ for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
18494
+ if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
18495
+ continue;
18496
+ }
18497
+ if (normalizedPath[i] === '..') {
18498
+ nb++;
18499
+ continue;
18500
+ }
18501
+ if (nb > 0) {
18502
+ nb--;
18503
+ continue;
18504
+ }
18505
+ o.push(normalizedPath[i]);
18506
+ }
18507
+ i = normalizedBase.length - nb;
18508
+ if (i <= 0) {
18509
+ outPath = reverse(o).join('/');
18510
+ } else {
18511
+ outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
18512
+ }
18513
+ if (outPath.indexOf('/') !== 0) {
18514
+ outPath = '/' + outPath;
18515
+ }
18516
+ if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
18517
+ outPath += tr;
18518
+ }
18519
+ return outPath;
18520
+ };
18521
+ URI.prototype.getURI = function (noProtoHost) {
18522
+ if (noProtoHost === void 0) {
18523
+ noProtoHost = false;
18524
+ }
18525
+ var s;
18526
+ if (!this.source || noProtoHost) {
18527
+ s = '';
18528
+ if (!noProtoHost) {
18529
+ if (this.protocol) {
18530
+ s += this.protocol + '://';
18531
+ } else {
18532
+ s += '//';
18533
+ }
18534
+ if (this.userInfo) {
18535
+ s += this.userInfo + '@';
18536
+ }
18537
+ if (this.host) {
18538
+ s += this.host;
18539
+ }
18540
+ if (this.port) {
18541
+ s += ':' + this.port;
18542
+ }
18543
+ }
18544
+ if (this.path) {
18545
+ s += this.path;
18546
+ }
18547
+ if (this.query) {
18548
+ s += '?' + this.query;
18549
+ }
18550
+ if (this.anchor) {
18551
+ s += '#' + this.anchor;
18552
+ }
18553
+ this.source = s;
18554
+ }
18555
+ return this.source;
18556
+ };
18557
+ return URI;
18558
+ }();
18559
+
18560
+ var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
18561
+ var isValidPrefixAttrName = function (name) {
18562
+ return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
18563
+ };
18564
+ var lazyTempDocument = cached(function () {
18565
+ return document.implementation.createHTMLDocument('parser');
18566
+ });
18567
+ var findMatchingEndTagIndex = function (schema, html, startIndex) {
18568
+ var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
18569
+ var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
18570
+ var shortEndedElements = schema.getShortEndedElements();
18571
+ var count = 1, index = startIndex;
18572
+ while (count !== 0) {
18573
+ startTagRegExp.lastIndex = index;
18574
+ while (true) {
18575
+ var startMatch = startTagRegExp.exec(html);
18576
+ if (startMatch === null) {
18577
+ return index;
18578
+ } else if (startMatch[1] === '!') {
18579
+ if (startsWith(startMatch[2], '--')) {
18580
+ index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
18581
+ } else {
18582
+ index = findCommentEndIndex(html, true, startMatch.index + 1);
18583
+ }
18584
+ break;
18585
+ } else {
18586
+ endTagRegExp.lastIndex = startTagRegExp.lastIndex;
18587
+ var endMatch = endTagRegExp.exec(html);
18588
+ if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
18589
+ continue;
18590
+ }
18591
+ if (startMatch[1] === '/') {
18592
+ count -= 1;
18593
+ } else if (!has$2(shortEndedElements, startMatch[2])) {
18594
+ count += 1;
18595
+ }
18596
+ index = startTagRegExp.lastIndex + endMatch[0].length;
18597
+ break;
18598
+ }
18599
+ }
18600
+ }
18601
+ return index;
18602
+ };
18603
+ var isConditionalComment = function (html, startIndex) {
18604
+ return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(html.substr(startIndex));
18605
+ };
18606
+ var findCommentEndIndex = function (html, isBogus, startIndex) {
18607
+ if (startIndex === void 0) {
18608
+ startIndex = 0;
18609
+ }
18610
+ var lcHtml = html.toLowerCase();
18611
+ if (lcHtml.indexOf('[if ', startIndex) !== -1 && isConditionalComment(lcHtml, startIndex)) {
18612
+ var endIfIndex = lcHtml.indexOf('[endif]', startIndex);
18613
+ return lcHtml.indexOf('>', endIfIndex);
18614
+ } else {
18615
+ if (isBogus) {
18616
+ var endIndex = lcHtml.indexOf('>', startIndex);
18617
+ return endIndex !== -1 ? endIndex : lcHtml.length;
18618
+ } else {
18619
+ var endCommentRegexp = /--!?>/g;
18620
+ endCommentRegexp.lastIndex = startIndex;
18621
+ var match = endCommentRegexp.exec(html);
18622
+ return match ? match.index + match[0].length : lcHtml.length;
18623
+ }
18624
+ }
18625
+ };
18626
+ var checkBogusAttribute = function (regExp, attrString) {
18627
+ var matches = regExp.exec(attrString);
18628
+ if (matches) {
18629
+ var name_1 = matches[1];
18630
+ var value = matches[2];
18631
+ return typeof name_1 === 'string' && name_1.toLowerCase() === 'data-mce-bogus' ? value : null;
18632
+ } else {
18633
+ return null;
18634
+ }
18635
+ };
18636
+ var SaxParser = function (settings, schema) {
18637
+ if (schema === void 0) {
18638
+ schema = Schema();
18639
+ }
18640
+ settings = settings || {};
18641
+ var doc = lazyTempDocument();
18642
+ var form = doc.createElement('form');
18643
+ if (settings.fix_self_closing !== false) {
18644
+ settings.fix_self_closing = true;
18645
+ }
18646
+ var comment = settings.comment ? settings.comment : noop;
18647
+ var cdata = settings.cdata ? settings.cdata : noop;
18648
+ var text = settings.text ? settings.text : noop;
18649
+ var start = settings.start ? settings.start : noop;
18650
+ var end = settings.end ? settings.end : noop;
18651
+ var pi = settings.pi ? settings.pi : noop;
18652
+ var doctype = settings.doctype ? settings.doctype : noop;
18653
+ var parseInternal = function (base64Extract, format) {
18654
+ if (format === void 0) {
18655
+ format = 'html';
18656
+ }
18657
+ var html = base64Extract.html;
18658
+ var matches, index = 0, value, endRegExp;
18659
+ var stack = [];
18660
+ var attrList, i, textData, name;
18661
+ var isInternalElement, isShortEnded;
18662
+ var elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
18663
+ var attributesRequired, attributesDefault, attributesForced;
18664
+ var anyAttributesRequired, attrValue, idCount = 0;
18665
+ var decode = Entities.decode;
18666
+ var filteredUrlAttrs = Tools.makeMap('src,href,data,background,action,formaction,poster,xlink:href');
18667
+ var parsingMode = format === 'html' ? 0 : 1;
18668
+ var processEndTag = function (name) {
18669
+ var pos, i;
18670
+ pos = stack.length;
18671
+ while (pos--) {
18672
+ if (stack[pos].name === name) {
18673
+ break;
18674
+ }
18675
+ }
18676
+ if (pos >= 0) {
18677
+ for (i = stack.length - 1; i >= pos; i--) {
18678
+ name = stack[i];
18679
+ if (name.valid) {
18680
+ end(name.name);
18681
+ }
18682
+ }
18683
+ stack.length = pos;
18684
+ }
18685
+ };
18686
+ var processText = function (value, raw) {
18687
+ return text(restoreDataUris(value, base64Extract), raw);
18688
+ };
18689
+ var processComment = function (value) {
18690
+ if (value === '') {
18691
+ return;
18692
+ }
18693
+ if (value.charAt(0) === '>') {
18694
+ value = ' ' + value;
18695
+ }
18696
+ if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') {
18697
+ value = ' ' + value;
18698
+ }
18699
+ comment(restoreDataUris(value, base64Extract));
18700
+ };
18701
+ var processAttr = function (value) {
18702
+ return restoreDataUris(value, base64Extract);
18703
+ };
18704
+ var processMalformedComment = function (value, startIndex) {
18705
+ var startTag = value || '';
18706
+ var isBogus = !startsWith(startTag, '--');
18707
+ var endIndex = findCommentEndIndex(html, isBogus, startIndex);
18708
+ value = html.substr(startIndex, endIndex - startIndex);
18709
+ processComment(isBogus ? startTag + value : value);
18710
+ return endIndex + 1;
18711
+ };
18712
+ var parseAttribute = function (tagName, name, value, val2, val3) {
18713
+ name = name.toLowerCase();
18714
+ value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || ''));
18715
+ if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
18716
+ var attrRule = validAttributesMap[name];
18717
+ if (!attrRule && validAttributePatterns) {
18718
+ var i_1 = validAttributePatterns.length;
18719
+ while (i_1--) {
18720
+ attrRule = validAttributePatterns[i_1];
18721
+ if (attrRule.pattern.test(name)) {
18722
+ break;
18723
+ }
18724
+ }
18725
+ if (i_1 === -1) {
18726
+ attrRule = null;
18727
+ }
18728
+ }
18729
+ if (!attrRule) {
18730
+ return;
18731
+ }
18732
+ if (attrRule.validValues && !(value in attrRule.validValues)) {
18733
+ return;
18734
+ }
18735
+ }
18736
+ var isNameOrId = name === 'name' || name === 'id';
18737
+ if (isNameOrId && tagName in filteredClobberElements && (value in doc || value in form)) {
18738
+ return;
18739
+ }
18740
+ if (filteredUrlAttrs[name] && !URI.isDomSafe(value, tagName, settings)) {
18741
+ return;
18742
+ }
18743
+ if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
18744
+ return;
18745
+ }
18746
+ attrList.map[name] = value;
18747
+ attrList.push({
18748
+ name: name,
18749
+ value: value
18750
+ });
18751
+ };
18752
+ var tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)--!?>)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|' + '(?:!(--)?)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^\'">]+(?:"[^"]*"|\'[^\']*\'))*[^"\'>]*(?:"[^">]*|\'[^\'>]*)?|\\s*|\\/)>)' + ')', 'g');
18753
+ var attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
18754
+ var shortEndedElements = schema.getShortEndedElements();
18755
+ var selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
18756
+ var fillAttrsMap = schema.getBoolAttrs();
18757
+ var validate = settings.validate;
18758
+ var removeInternalElements = settings.remove_internals;
18759
+ var fixSelfClosing = settings.fix_self_closing;
18760
+ var specialElements = schema.getSpecialElements();
18761
+ var processHtml = html + '>';
18762
+ while (matches = tokenRegExp.exec(processHtml)) {
18763
+ var matchText = matches[0];
18764
+ if (index < matches.index) {
18765
+ processText(decode(html.substr(index, matches.index - index)));
18766
+ }
18767
+ if (value = matches[7]) {
18768
+ value = value.toLowerCase();
18769
+ if (value.charAt(0) === ':') {
18770
+ value = value.substr(1);
18771
+ }
18772
+ processEndTag(value);
18773
+ } else if (value = matches[8]) {
18774
+ if (matches.index + matchText.length > html.length) {
18775
+ processText(decode(html.substr(matches.index)));
18776
+ index = matches.index + matchText.length;
18777
+ continue;
18778
+ }
18779
+ value = value.toLowerCase();
18780
+ if (value.charAt(0) === ':') {
18781
+ value = value.substr(1);
18782
+ }
18783
+ isShortEnded = value in shortEndedElements;
18784
+ if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
18785
+ processEndTag(value);
18786
+ }
18787
+ var bogusValue = checkBogusAttribute(attrRegExp, matches[9]);
18788
+ if (bogusValue !== null) {
18789
+ if (bogusValue === 'all') {
18790
+ index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
18791
+ tokenRegExp.lastIndex = index;
18792
+ continue;
18793
+ }
18794
+ isValidElement = false;
18795
+ }
18796
+ if (!validate || (elementRule = schema.getElementRule(value))) {
18797
+ isValidElement = true;
18798
+ if (validate) {
18799
+ validAttributesMap = elementRule.attributes;
18800
+ validAttributePatterns = elementRule.attributePatterns;
18801
+ }
18802
+ if (attribsValue = matches[9]) {
18803
+ isInternalElement = attribsValue.indexOf('data-mce-type') !== -1;
18804
+ if (isInternalElement && removeInternalElements) {
18805
+ isValidElement = false;
18806
+ }
18807
+ attrList = [];
18808
+ attrList.map = {};
18809
+ attribsValue.replace(attrRegExp, function (match, name, val, val2, val3) {
18810
+ parseAttribute(value, name, val, val2, val3);
18811
+ return '';
18812
+ });
18813
+ } else {
18814
+ attrList = [];
18815
+ attrList.map = {};
18816
+ }
18817
+ if (validate && !isInternalElement) {
18818
+ attributesRequired = elementRule.attributesRequired;
18819
+ attributesDefault = elementRule.attributesDefault;
18820
+ attributesForced = elementRule.attributesForced;
18821
+ anyAttributesRequired = elementRule.removeEmptyAttrs;
18822
+ if (anyAttributesRequired && !attrList.length) {
18823
+ isValidElement = false;
18824
+ }
18825
+ if (attributesForced) {
18826
+ i = attributesForced.length;
18827
+ while (i--) {
18828
+ attr = attributesForced[i];
18829
+ name = attr.name;
18830
+ attrValue = attr.value;
18831
+ if (attrValue === '{$uid}') {
18832
+ attrValue = 'mce_' + idCount++;
18833
+ }
18834
+ attrList.map[name] = attrValue;
18835
+ attrList.push({
18836
+ name: name,
18837
+ value: attrValue
18838
+ });
18839
+ }
18840
+ }
18841
+ if (attributesDefault) {
18842
+ i = attributesDefault.length;
18843
+ while (i--) {
18844
+ attr = attributesDefault[i];
18845
+ name = attr.name;
18846
+ if (!(name in attrList.map)) {
18847
+ attrValue = attr.value;
18848
+ if (attrValue === '{$uid}') {
18849
+ attrValue = 'mce_' + idCount++;
18850
+ }
18851
+ attrList.map[name] = attrValue;
18852
+ attrList.push({
18853
+ name: name,
18854
+ value: attrValue
18855
+ });
18856
+ }
18857
+ }
18753
18858
  }
18754
- prev = prev.prev;
18755
- }
18756
- if (node) {
18757
- node.remove();
18758
- if (isEmpty(schema, nonEmptyElements, whiteSpaceElements, parent)) {
18759
- elementRule = schema.getElementRule(parent.name);
18760
- if (elementRule) {
18761
- if (elementRule.removeEmpty) {
18762
- parent.remove();
18763
- } else if (elementRule.paddEmpty) {
18764
- paddEmptyNode(settings, args, blockElements, parent);
18859
+ if (attributesRequired) {
18860
+ i = attributesRequired.length;
18861
+ while (i--) {
18862
+ if (attributesRequired[i] in attrList.map) {
18863
+ break;
18765
18864
  }
18766
18865
  }
18866
+ if (i === -1) {
18867
+ isValidElement = false;
18868
+ }
18767
18869
  }
18768
- }
18769
- } else {
18770
- lastParent = node;
18771
- while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
18772
- lastParent = parent;
18773
- if (blockElements[parent.name]) {
18774
- break;
18870
+ if (attr = attrList.map['data-mce-bogus']) {
18871
+ if (attr === 'all') {
18872
+ index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
18873
+ tokenRegExp.lastIndex = index;
18874
+ continue;
18875
+ }
18876
+ isValidElement = false;
18775
18877
  }
18776
- parent = parent.parent;
18777
18878
  }
18778
- if (lastParent === parent && settings.padd_empty_with_br !== true) {
18779
- textNode = new AstNode('#text', 3);
18780
- textNode.value = nbsp;
18781
- node.replace(textNode);
18879
+ if (isValidElement) {
18880
+ start(value, attrList, isShortEnded);
18782
18881
  }
18882
+ } else {
18883
+ isValidElement = false;
18783
18884
  }
18784
- }
18785
- });
18786
- }
18787
- parser.addAttributeFilter('href', function (nodes) {
18788
- var i = nodes.length;
18789
- var appendRel = function (rel) {
18790
- var parts = rel.split(' ').filter(function (p) {
18791
- return p.length > 0;
18792
- });
18793
- return parts.concat(['noopener']).sort().join(' ');
18794
- };
18795
- var addNoOpener = function (rel) {
18796
- var newRel = rel ? Tools.trim(rel) : '';
18797
- if (!/\b(noopener)\b/g.test(newRel)) {
18798
- return appendRel(newRel);
18799
- } else {
18800
- return newRel;
18801
- }
18802
- };
18803
- if (!settings.allow_unsafe_link_target) {
18804
- while (i--) {
18805
- var node = nodes[i];
18806
- if (node.name === 'a' && node.attr('target') === '_blank') {
18807
- node.attr('rel', addNoOpener(node.attr('rel')));
18808
- }
18809
- }
18810
- }
18811
- });
18812
- if (!settings.allow_html_in_named_anchor) {
18813
- parser.addAttributeFilter('id,name', function (nodes) {
18814
- var i = nodes.length, sibling, prevSibling, parent, node;
18815
- while (i--) {
18816
- node = nodes[i];
18817
- if (node.name === 'a' && node.firstChild && !node.attr('href')) {
18818
- parent = node.parent;
18819
- sibling = node.lastChild;
18820
- do {
18821
- prevSibling = sibling.prev;
18822
- parent.insert(sibling, node);
18823
- sibling = prevSibling;
18824
- } while (sibling);
18825
- }
18826
- }
18827
- });
18828
- }
18829
- if (settings.fix_list_elements) {
18830
- parser.addNodeFilter('ul,ol', function (nodes) {
18831
- var i = nodes.length, node, parentNode;
18832
- while (i--) {
18833
- node = nodes[i];
18834
- parentNode = node.parent;
18835
- if (parentNode.name === 'ul' || parentNode.name === 'ol') {
18836
- if (node.prev && node.prev.name === 'li') {
18837
- node.prev.append(node);
18885
+ if (endRegExp = specialElements[value]) {
18886
+ endRegExp.lastIndex = index = matches.index + matchText.length;
18887
+ if (matches = endRegExp.exec(html)) {
18888
+ if (isValidElement) {
18889
+ textData = html.substr(index, matches.index - index);
18890
+ }
18891
+ index = matches.index + matches[0].length;
18838
18892
  } else {
18839
- var li = new AstNode('li', 1);
18840
- li.attr('style', 'list-style-type: none');
18841
- node.wrap(li);
18842
- }
18843
- }
18844
- }
18845
- });
18846
- }
18847
- if (settings.validate && schema.getValidClasses()) {
18848
- parser.addAttributeFilter('class', function (nodes) {
18849
- var validClasses = schema.getValidClasses();
18850
- var i = nodes.length;
18851
- while (i--) {
18852
- var node = nodes[i];
18853
- var classList = node.attr('class').split(' ');
18854
- var classValue = '';
18855
- for (var ci = 0; ci < classList.length; ci++) {
18856
- var className = classList[ci];
18857
- var valid = false;
18858
- var validClassesMap = validClasses['*'];
18859
- if (validClassesMap && validClassesMap[className]) {
18860
- valid = true;
18861
- }
18862
- validClassesMap = validClasses[node.name];
18863
- if (!valid && validClassesMap && validClassesMap[className]) {
18864
- valid = true;
18893
+ textData = html.substr(index);
18894
+ index = html.length;
18865
18895
  }
18866
- if (valid) {
18867
- if (classValue) {
18868
- classValue += ' ';
18896
+ if (isValidElement) {
18897
+ if (textData.length > 0) {
18898
+ processText(textData, true);
18869
18899
  }
18870
- classValue += className;
18900
+ end(value);
18871
18901
  }
18902
+ tokenRegExp.lastIndex = index;
18903
+ continue;
18872
18904
  }
18873
- if (!classValue.length) {
18874
- classValue = null;
18905
+ if (!isShortEnded) {
18906
+ if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) {
18907
+ stack.push({
18908
+ name: value,
18909
+ valid: isValidElement
18910
+ });
18911
+ } else if (isValidElement) {
18912
+ end(value);
18913
+ }
18914
+ }
18915
+ } else if (value = matches[1]) {
18916
+ processComment(value);
18917
+ } else if (value = matches[2]) {
18918
+ var isValidCdataSection = parsingMode === 1 || settings.preserve_cdata || stack.length > 0 && schema.isValidChild(stack[stack.length - 1].name, '#cdata');
18919
+ if (isValidCdataSection) {
18920
+ cdata(value);
18921
+ } else {
18922
+ index = processMalformedComment('', matches.index + 2);
18923
+ tokenRegExp.lastIndex = index;
18924
+ continue;
18925
+ }
18926
+ } else if (value = matches[3]) {
18927
+ doctype(value);
18928
+ } else if ((value = matches[4]) || matchText === '<!') {
18929
+ index = processMalformedComment(value, matches.index + matchText.length);
18930
+ tokenRegExp.lastIndex = index;
18931
+ continue;
18932
+ } else if (value = matches[5]) {
18933
+ if (parsingMode === 1) {
18934
+ pi(value, matches[6]);
18935
+ } else {
18936
+ index = processMalformedComment('?', matches.index + 2);
18937
+ tokenRegExp.lastIndex = index;
18938
+ continue;
18875
18939
  }
18876
- node.attr('class', classValue);
18877
18940
  }
18878
- });
18879
- }
18880
- registerBase64ImageFilter(parser, settings);
18941
+ index = matches.index + matchText.length;
18942
+ }
18943
+ if (index < html.length) {
18944
+ processText(decode(html.substr(index)));
18945
+ }
18946
+ for (i = stack.length - 1; i >= 0; i--) {
18947
+ value = stack[i];
18948
+ if (value.valid) {
18949
+ end(value.name);
18950
+ }
18951
+ }
18952
+ };
18953
+ var parse = function (html, format) {
18954
+ if (format === void 0) {
18955
+ format = 'html';
18956
+ }
18957
+ parseInternal(extractBase64DataUris(html), format);
18958
+ };
18959
+ return { parse: parse };
18881
18960
  };
18961
+ SaxParser.findEndTag = findMatchingEndTagIndex;
18882
18962
 
18883
18963
  var makeMap = Tools.makeMap, each$6 = Tools.each, explode$2 = Tools.explode, extend$4 = Tools.extend;
18884
18964
  var DomParser = function (settings, schema) {
@@ -19075,6 +19155,7 @@
19075
19155
  matchedNodes = {};
19076
19156
  matchedAttributes = {};
19077
19157
  var blockElements = extend$4(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
19158
+ var textRootBlockElements = getTextRootBlockElements(schema);
19078
19159
  var nonEmptyElements = schema.getNonEmptyElements();
19079
19160
  var children = schema.children;
19080
19161
  var validate = settings.validate;
@@ -19168,6 +19249,17 @@
19168
19249
  }
19169
19250
  return output;
19170
19251
  };
19252
+ var isTextRootBlockEmpty = function (node) {
19253
+ var tempNode = node;
19254
+ while (isNonNullable(tempNode)) {
19255
+ if (tempNode.name in textRootBlockElements) {
19256
+ return isEmpty(schema, nonEmptyElements, whiteSpaceElements, tempNode);
19257
+ } else {
19258
+ tempNode = tempNode.parent;
19259
+ }
19260
+ }
19261
+ return false;
19262
+ };
19171
19263
  var parser = SaxParser({
19172
19264
  validate: validate,
19173
19265
  document: settings.document,
@@ -19241,7 +19333,7 @@
19241
19333
  }
19242
19334
  },
19243
19335
  end: function (name) {
19244
- var textNode, text, sibling, tempNode;
19336
+ var textNode, text, sibling;
19245
19337
  var elementRule = validate ? schema.getElementRule(name) : {};
19246
19338
  if (elementRule) {
19247
19339
  if (blockElements[name]) {
@@ -19293,20 +19385,20 @@
19293
19385
  if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
19294
19386
  isInWhiteSpacePreservedElement = false;
19295
19387
  }
19296
- if (elementRule.removeEmpty && isEmpty(schema, nonEmptyElements, whiteSpaceElements, node)) {
19297
- tempNode = node.parent;
19388
+ var isNodeEmpty = isEmpty(schema, nonEmptyElements, whiteSpaceElements, node);
19389
+ var parentNode = node.parent;
19390
+ if (elementRule.paddInEmptyBlock && isNodeEmpty && isTextRootBlockEmpty(node)) {
19391
+ paddEmptyNode(settings, args, blockElements, node);
19392
+ } else if (elementRule.removeEmpty && isNodeEmpty) {
19298
19393
  if (blockElements[node.name]) {
19299
19394
  node.empty().remove();
19300
19395
  } else {
19301
19396
  node.unwrap();
19302
19397
  }
19303
- node = tempNode;
19304
- return;
19305
- }
19306
- if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty(schema, nonEmptyElements, whiteSpaceElements, node))) {
19398
+ } else if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isNodeEmpty)) {
19307
19399
  paddEmptyNode(settings, args, blockElements, node);
19308
19400
  }
19309
- node = node.parent;
19401
+ node = parentNode;
19310
19402
  }
19311
19403
  }
19312
19404
  }, schema);
@@ -19573,7 +19665,7 @@
19573
19665
  }
19574
19666
  };
19575
19667
  var getHtmlFromNode = function (dom, node, args) {
19576
- var html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
19668
+ var html = trim$3(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
19577
19669
  return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html);
19578
19670
  };
19579
19671
  var parseHtml = function (htmlParser, html, args) {
@@ -19815,7 +19907,7 @@
19815
19907
  };
19816
19908
  var normalizePlugins = function (plugins) {
19817
19909
  var pluginNames = isArray$1(plugins) ? plugins.join(' ') : plugins;
19818
- var trimmedPlugins = map$3(isString$1(pluginNames) ? pluginNames.split(' ') : [], trim$4);
19910
+ var trimmedPlugins = map$3(isString$1(pluginNames) ? pluginNames.split(' ') : [], trim$5);
19819
19911
  return filter$4(trimmedPlugins, function (item) {
19820
19912
  return item.length > 0;
19821
19913
  });
@@ -24390,7 +24482,7 @@
24390
24482
  var trimZwsp = function (fragment) {
24391
24483
  each$k(descendants$1(SugarElement.fromDom(fragment), isText$8), function (text) {
24392
24484
  var rawNode = text.dom;
24393
- rawNode.nodeValue = trim$2(rawNode.nodeValue);
24485
+ rawNode.nodeValue = trim$3(rawNode.nodeValue);
24394
24486
  });
24395
24487
  };
24396
24488
  var isEmptyAnchor = function (dom, elm) {
@@ -26525,6 +26617,32 @@
26525
26617
  return isUndefined(v) === false;
26526
26618
  });
26527
26619
  };
26620
+ var mkSchemaSettings = function (editor) {
26621
+ var settings = editor.settings;
26622
+ return removeUndefined({
26623
+ block_elements: settings.block_elements,
26624
+ boolean_attributes: settings.boolean_attributes,
26625
+ custom_elements: settings.custom_elements,
26626
+ extended_valid_elements: settings.extended_valid_elements,
26627
+ invalid_elements: settings.invalid_elements,
26628
+ invalid_styles: settings.invalid_styles,
26629
+ move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements,
26630
+ non_empty_elements: settings.non_empty_elements,
26631
+ schema: settings.schema,
26632
+ self_closing_elements: settings.self_closing_elements,
26633
+ short_ended_elements: settings.short_ended_elements,
26634
+ special: settings.special,
26635
+ text_block_elements: settings.text_block_elements,
26636
+ text_inline_elements: settings.text_inline_elements,
26637
+ valid_children: settings.valid_children,
26638
+ valid_classes: settings.valid_classes,
26639
+ valid_elements: settings.valid_elements,
26640
+ valid_styles: settings.valid_styles,
26641
+ verify_html: settings.verify_html,
26642
+ whitespace_elements: settings.whitespace_elements,
26643
+ padd_empty_block_inline_children: settings.format_empty_lines
26644
+ });
26645
+ };
26528
26646
  var mkParserSettings = function (editor) {
26529
26647
  var settings = editor.settings;
26530
26648
  var blobCache = editor.editorUpload.blobCache;
@@ -26553,7 +26671,7 @@
26553
26671
  };
26554
26672
  var mkSerializerSettings = function (editor) {
26555
26673
  var settings = editor.settings;
26556
- return __assign(__assign({}, mkParserSettings(editor)), removeUndefined({
26674
+ return __assign(__assign(__assign({}, mkParserSettings(editor)), mkSchemaSettings(editor)), removeUndefined({
26557
26675
  url_converter: settings.url_converter,
26558
26676
  url_converter_scope: settings.url_converter_scope,
26559
26677
  element_format: settings.element_format,
@@ -26561,27 +26679,7 @@
26561
26679
  entity_encoding: settings.entity_encoding,
26562
26680
  indent: settings.indent,
26563
26681
  indent_after: settings.indent_after,
26564
- indent_before: settings.indent_before,
26565
- block_elements: settings.block_elements,
26566
- boolean_attributes: settings.boolean_attributes,
26567
- custom_elements: settings.custom_elements,
26568
- extended_valid_elements: settings.extended_valid_elements,
26569
- invalid_elements: settings.invalid_elements,
26570
- invalid_styles: settings.invalid_styles,
26571
- move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements,
26572
- non_empty_elements: settings.non_empty_elements,
26573
- schema: settings.schema,
26574
- self_closing_elements: settings.self_closing_elements,
26575
- short_ended_elements: settings.short_ended_elements,
26576
- special: settings.special,
26577
- text_block_elements: settings.text_block_elements,
26578
- text_inline_elements: settings.text_inline_elements,
26579
- valid_children: settings.valid_children,
26580
- valid_classes: settings.valid_classes,
26581
- valid_elements: settings.valid_elements,
26582
- valid_styles: settings.valid_styles,
26583
- verify_html: settings.verify_html,
26584
- whitespace_elements: settings.whitespace_elements
26682
+ indent_before: settings.indent_before
26585
26683
  }));
26586
26684
  };
26587
26685
  var createParser = function (editor) {
@@ -26804,7 +26902,7 @@
26804
26902
  }
26805
26903
  body.disabled = false;
26806
26904
  editor.editorUpload = EditorUpload(editor);
26807
- editor.schema = Schema(settings);
26905
+ editor.schema = Schema(mkSchemaSettings(editor));
26808
26906
  editor.dom = DOMUtils(doc, {
26809
26907
  keep_values: true,
26810
26908
  url_converter: editor.convertURL,
@@ -28996,8 +29094,8 @@
28996
29094
  suffix: null,
28997
29095
  $: DomQuery,
28998
29096
  majorVersion: '5',
28999
- minorVersion: '10.2',
29000
- releaseDate: '2021-11-17',
29097
+ minorVersion: '10.9',
29098
+ releaseDate: '2023-11-15',
29001
29099
  editors: legacyEditors,
29002
29100
  i18n: I18n,
29003
29101
  activeEditor: null,