Skip to content

Commit

Permalink
fix(NcRichContenteditable): Fix pasting XML and HTML content
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Mar 23, 2023
1 parent b059218 commit 35c79ee
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,16 +482,16 @@ export default {
return
}
const html = clipboardData.getData('text')
const text = clipboardData.getData('text')
const selection = window.getSelection()
// If no selection, replace the whole data
if (!selection.rangeCount) {
this.updateValue(html)
this.updateValue(text)
return
}
// Generate text and insert
const text = this.parseContent(html)
const range = selection.getRangeAt(0)
selection.deleteFromDocument()
range.insertNode(document.createTextNode(text))
Expand Down

0 comments on commit 35c79ee

Please sign in to comment.