Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Fixes a crash on pasting MS Word list markup #56653

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For each user feature we should also add a importance categorization label to i

## Unreleased
- [***] Fix issue when backspacing in an empty Paragraph block [#56496]
- [**] Fixes a crash on pasting MS Word list markup [#56653]

## 1.109.0
- [*] Audio block: Improve legibility of audio file details on various background colors [#55627]
Expand Down
12 changes: 12 additions & 0 deletions packages/react-native-editor/src/jsdom-patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,18 @@ Element.prototype.closest = function ( selector ) {
return null;
};

/**
* Implementation of Element.prototype.remove based on polyfills:
* - https://github.com/chenzhenxi/element-remove/blob/master/index.js
* (referenced in https://developer.mozilla.org/en-US/docs/Web/API/Element/remove#see_also)
* - https://github.com/JakeChampion/polyfill-library/blob/master/polyfills/Element/prototype/remove/polyfill.js
*/
Element.prototype.remove = function () {
if ( this.parentNode ) {
this.parentNode.removeChild( this );
}
};

/**
* Helper function to check if a node implements the NonDocumentTypeChildNode
* interface
Expand Down
1 change: 0 additions & 1 deletion test/native/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const transpiledPackageNames = glob( 'packages/*/src/index.{js,ts}' ).map(
const RAW_HANDLING_UNSUPPORTED_UNIT_TESTS = [
'html-formatting-remover',
'phrasing-content-reducer',
'ms-list-converter',
'figure-content-reducer',
'special-comment-converter',
'normalise-blocks',
Expand Down
Loading