Skip to content

Commit

Permalink
[Mobile] - Fix issues when pasting HTML content (#62588)
Browse files Browse the repository at this point in the history
* iOS - readHTML remove DOCTYPE check since pasteHandler handles it

* Update changelog
  • Loading branch information
geriux committed Jun 17, 2024
1 parent 708ce27 commit 6633dc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,8 @@ class RCTAztecView: Aztec.TextView {
}

private func readHTML(from pasteboard: UIPasteboard) -> String? {

if let data = pasteboard.data(forPasteboardType: kUTTypeHTML as String), let html = String(data: data, encoding: .utf8) {
// Make sure we are not getting a full HTML DOC. We only want inner content
if !html.hasPrefix("<!DOCTYPE html") {
return html
}
return html
}

if let flatRTFDString = read(from: pasteboard, uti: kUTTypeFlatRTFD, documentType: DocumentType.rtfd) {
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ For each user feature we should also add a importance categorization label to i
- [internal] Fix Inserter items list filtering [#62334]
- [*] Prevent hiding the keyboard when creating new list items [#62446]
- [*] RichText - Fix undefined onDelete callback [#62486]
- [*] Fix issue when pasting HTML content [#62588]

## 1.120.0
- [*] Prevent deleting content when backspacing in the first Paragraph block [#62069]
Expand Down

0 comments on commit 6633dc3

Please sign in to comment.