Fix pasting html into EditableContent
This commit is contained in:
parent
2189301b3c
commit
dab68de1f0
1 changed files with 2 additions and 0 deletions
|
@ -91,6 +91,8 @@ Ox.EditableContent = function(options, self) {
|
||||||
if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
|
if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
|
||||||
Ox.print('TYPES', e.originalEvent.clipboardData.types);
|
Ox.print('TYPES', e.originalEvent.clipboardData.types);
|
||||||
var value = e.originalEvent.clipboardData.getData('text/plain');
|
var value = e.originalEvent.clipboardData.getData('text/plain');
|
||||||
|
value = Ox.encodeHTMLEntities(value).replace('\n', '<br/>\n');
|
||||||
|
Ox.print('VALUE', value);
|
||||||
document.execCommand('insertHTML', false, value);
|
document.execCommand('insertHTML', false, value);
|
||||||
e.originalEvent.stopPropagation();
|
e.originalEvent.stopPropagation();
|
||||||
e.originalEvent.preventDefault();
|
e.originalEvent.preventDefault();
|
||||||
|
|
Loading…
Reference in a new issue