Index: quicktags.js
===================================================================
--- quicktags.js	(revision 29492)
+++ quicktags.js	(working copy)
@@ -491,6 +491,11 @@
 					canvas.value = l + i + t.tagStart + r; // insert self closing tags after the selection
 					cursorPos += t.tagStart.length;
 				} else {
+					if ( i.charAt(i.length - 1) === '\n' ) { // WebKit
+						i = i.substring(0, i.length - 1);
+						r = '\n' + r;
+						cursorPos -= 1;
+					}
 					canvas.value = l + t.tagStart + i + endTag + r;
 					cursorPos += t.tagStart.length + endTag.length;
 				}
