diff --git a/source/Clean.js b/source/Clean.js index 326e8e7..8c1f086 100644 --- a/source/Clean.js +++ b/source/Clean.js @@ -238,7 +238,7 @@ var cleanTree = function cleanTree ( node, config, preserveWS ) { break; } } - data = data.replace( /^[ \t\r\n]+/g, sibling ? ' ' : '' ); + data = data.replace( /^[ \r\n]+/g, sibling ? ' ' : '' ); } if ( endsWithWS ) { walker.currentNode = child; @@ -253,7 +253,7 @@ var cleanTree = function cleanTree ( node, config, preserveWS ) { break; } } - data = data.replace( /[ \t\r\n]+$/g, sibling ? ' ' : '' ); + data = data.replace( /[ \r\n]+$/g, sibling ? ' ' : '' ); } if ( data ) { child.data = data; diff --git a/source/Editor.js b/source/Editor.js index f024e79..4ee294c 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -120,7 +120,8 @@ var sanitizeToDOMFragment = function ( html, isPaste, self ) { ALLOW_UNKNOWN_PROTOCOLS: true, WHOLE_DOCUMENT: false, RETURN_DOM: true, - RETURN_DOM_FRAGMENT: true + RETURN_DOM_FRAGMENT: true, + FORCE_BODY: false }) : null; return frag ? doc.importNode( frag, true ) : doc.createDocumentFragment(); };