better newline matching

This commit is contained in:
j 2013-09-27 14:29:34 +00:00
parent dab68de1f0
commit a9a804887a

View file

@ -91,8 +91,7 @@ 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);
value = Ox.encodeHTMLEntities(value).replace(/\n\n\n/g, '<br/><br/>\n');
document.execCommand('insertHTML', false, value);
e.originalEvent.stopPropagation();
e.originalEvent.preventDefault();