@contentful/field-editor-rich-text 3.4.15 → 3.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.4.16](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.4.15...@contentful/field-editor-rich-text@3.4.16) (2023-03-31)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **rte:** pasting tables from ms word or google docs freezes the page ([#1384](https://github.com/contentful/field-editors/issues/1384)) ([b89cd18](https://github.com/contentful/field-editors/commit/b89cd181080706a8e93992843fe937bfe63d037f))
11
+
6
12
  ## [3.4.15](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.4.14...@contentful/field-editor-rich-text@3.4.15) (2023-03-20)
7
13
 
8
14
  ### Bug Fixes
@@ -6264,12 +6264,10 @@ var sanitizeHTML = function sanitizeHTML(html) {
6264
6264
 
6265
6265
  if (doc.querySelector('table')) {
6266
6266
  // remove div container from tables
6267
- // capture groups explained:
6268
- // 1. and 3. every content/linebreaks before and after the div container
6269
- // 2. the table inside the container, including content and linebreaks
6270
6267
  // The div container including attributes and possible linebreaks inside wil be removed
6271
6268
  replacers.unshift(function (innerHtml) {
6272
- return innerHtml.replace(/(.*\s)?<div.*>\s*(<table(?:.|\s)*<\/table>)\s*<\/div>(.*\s)?/g, '$1$2$3');
6269
+ var result = innerHtml.replace(/<div[^>]*>\s*(<table(?:.|\s)*<\/table>)\s*<\/div>/g, '$1');
6270
+ return result;
6273
6271
  });
6274
6272
  }
6275
6273