Fix pasting html into EditableContent

This commit is contained in:
j 2013-09-27 14:17:16 +00:00
parent 2189301b3c
commit dab68de1f0

View file

@ -91,6 +91,8 @@ Ox.EditableContent = function(options, self) {
if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
Ox.print('TYPES', e.originalEvent.clipboardData.types);
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);
e.originalEvent.stopPropagation();
e.originalEvent.preventDefault();