I have a contentEditable and I strip the formatting of pasted content on(\'paste\') by catching the event. Then I focus a textarea, paste the content i
contentEditable
on(\'paste\')
The solution I used is to set the innerText of the element on blur:
$element.on('blur', () => this.innerText = this.innerText);
This keeps the whitespace, but strips the formatting. It may work acceptable in your scenario as well.