diff --git a/plugins/break/break.js b/plugins/break/break.js
index 54aac4c..6d8f025 100644
--- a/plugins/break/break.js
+++ b/plugins/break/break.js
@@ -38,6 +38,13 @@ Drupal.wysiwyg.plugins['break'] = {
    * Replace all <!--break--> tags with images.
    */
   attach: function(content, settings, instanceId) {
+    // Remove unnecessary paragraph.
+    content = content.replace(/<p><!--break--><\/p>/ig, this._getPlaceholder(settings));
+    // Move breaks starting at the beginning of paragraphs to before them.
+    content = content.replace(/<p><!--break-->(<[^p])/ig, this._getPlaceholder(settings) + '<p>$1');
+    // Move breaks starting at the end of to after the paragraphs.
+    content = content.replace(/([^p]>)<!--break--><\/p>/ig, '$1</p>' + this._getPlaceholder(settings));
+    // Other breaks.
     content = content.replace(/<!--break-->/g, this._getPlaceholder(settings));
     return content;
   },
@@ -46,22 +53,33 @@ Drupal.wysiwyg.plugins['break'] = {
    * Replace images with <!--break--> tags in content upon detaching editor.
    */
   detach: function(content, settings, instanceId) {
-    var $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
-    // #404532: document.createComment() required or IE will strip the comment.
-    // #474908: IE 8 breaks when using jQuery methods to replace the elements.
-    // @todo Add a generic implementation for all Drupal plugins for this.
-    $.each($('img.wysiwyg-break', $content), function (i, elem) {
-      elem.parentNode.insertBefore(document.createComment('break'), elem);
-      elem.parentNode.removeChild(elem);
-    });
-    return $content.html();
+  //   console.log('original:\n'+content);
+  // Replace (duplicate) placeholders within p taqs with a single break.
+  var newContent = content.replace(/\s*<p[^>]*?>(?:\s*<img(?:\s*\w+=['"][^'"]*?['"]\s*)*?\s*class=['"][^'"]*?wysiwyg-break[^'"]*?['"]\s*(?:\s*\w+=['"][^'"]*?['"]\s*)*?(?:\/)?>\s*)+<\/p>\s*/ig, '<!--break-->');
+  //    console.log('1\n'+newContent);
+  // Replace all other placeholders.
+  newContent = newContent.replace(/<img(?:\s*\w+=['"][^'"]*?['"]\s*)*?\s*class=['"][^'"]*?wysiwyg-break[^'"]*?['"]\s*(?:\s*\w+=['"][^'"]*?['"]\s*)*?(?:\/)?>/ig, '<!--break-->');
+  //    console.log('2\n'+newContent);
+  // Fix paragraphs opening just before breaks.
+  newContent = newContent.replace(/(?:<!--break-->)*(<p[^>]*?>\s*)<!--break-->/ig, '<!--break-->$1');
+  //    console.log('3\n'+newContent);
+  // Remove duplicate breaks and any preceding whitespaces.
+  newContent = newContent.replace(/(?:\s*<!--break-->){2,}/g, '<!--break-->');
+  //    console.log('4\n'+newContent);
+  // Fix paragraphs ending after breaks.
+  newContent = newContent.replace(/<!--break-->(\s*<\/p>)(?:<!--break-->)*/ig, '$1<!--break-->');
+  //    console.log('5\n'+newContent);
+  // Remove duplicate breaks with trailing whitespaces.
+  newContent = newContent.replace(/(?:<!--break-->\s*){2,}/g, '<!--break-->');
+  //    console.log('done\n'+newContent);
+  return newContent;
   },
 
   /**
    * Helper function to return a HTML placeholder.
    */
   _getPlaceholder: function (settings) {
-    return '<img src="' + settings.path + '/images/spacer.gif" alt="&lt;--break-&gt;" title="&lt;--break--&gt;" class="wysiwyg-break drupal-content" />';
+    return '<img src="' + settings.path + '/images/spacer.gif" alt="&lt;--break--&gt;" title="&lt;--break--&gt;" class="wysiwyg-break drupal-content" />';
   }
 };
 
