Index: /CKEditor/tests/tt/3133/1.html
===================================================================
--- /CKEditor/tests/tt/3133/1.html	(revision 4550)
+++ /CKEditor/tests/tt/3133/1.html	(revision 4550)
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket Test: #2871</title>
+	<meta name="tags" content="editor,unit,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<script>
+( function()
+{
+	var ts, tc, test = CKEDITOR.test, assert = CKEDITOR.test.assert;
+
+	YAHOO.tool.TestRunner.add( ts = new CKEDITOR.test.suites.editorTestSuite(
+		{
+				editorName : 'editor1'
+		} ) );
+
+	ts.add( tc = new YAHOO.tool.TestCase(
+		{
+			setUp : function ()
+			{
+				// Force result data unformatted.
+				ts.editor.dataProcessor.writer._.rules = {};
+				ts.editor.focus();
+			},
+
+			test_insert_element_with_selection : function()
+			{
+				var editor = ts.editor;
+
+				test.setHtmlWithSelection(
+						editor.document.getBody(),
+						test.getValueAsHtml( 'input' ) );
+
+				editor.insertElement( new CKEDITOR.dom.element( 'img' ) );
+				assert.areSame( '<p>parag<img /></p><ul><li>t</li></ul>',
+								editor.getData(),
+								'Content after insertion is incorrect.' );
+			}
+
+		} ) );
+} )();
+	</script>
+</head>
+<body>
+<textarea id="input">
+<p>parag[raph</p>
+<ul>
+	<li>lis]t</li>
+</ul>
+</textarea>
+</body>
+</html>
