Index: /CKEditor/tests/tt/6987/1.html
===================================================================
--- /CKEditor/tests/tt/6987/1.html	(revision 6403)
+++ /CKEditor/tests/tt/6987/1.html	(revision 6403)
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+	"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+	<title>Ticket: #6987 insertHtml from dialog</title>
+	<meta name="tags" content="editor,manual,all">
+	<script type="text/javascript" src="../../cktester/cell.js"></script>
+	<style>
+		.cke_skin_kama
+		{
+			float:left;
+		}
+	</style>
+	<script>
+		YAHOO.util.Event.removeListener( window, 'load' );
+		window.onload = function ()
+		{
+			// Define custom toolbar
+			var toolbar = [ [ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike','-','Link', '-', 'MyButton' ] ];
+			// Replace the <textarea id="editor1"> with an CKEditor instance.
+			var editor = CKEDITOR.replace( 'editor1',
+				{
+					// Set custom toolbar.
+					toolbar : toolbar
+				});	
+			editor.on( 'pluginsLoaded', function( ev )
+				{
+					// If our custom dialog has not been registered, do that now.
+					if ( !CKEDITOR.dialog.exists( 'myDialog' ) )
+					{
+						// Finally, register the dialog.
+						CKEDITOR.dialog.add( 'myDialog', function( editor )
+						{
+							return {
+								title : 'My Dialog',
+								minWidth : 400,
+								minHeight : 200,
+								contents : [
+									{
+										id : 'tab1',
+										label : 'First Tab',
+										title : 'First Tab',
+										elements :
+										[
+											{
+												id : 'input1',
+												type : 'text',
+												label : 'Input 1'
+											}
+										]
+									}
+								],
+								onOk : function() {
+									editor.insertHtml( this.getValueOf( 'tab1', 'input1' ) );
+								}
+							};
+						} );
+					}
+
+					// Register the command used to open the dialog.
+					editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
+
+					// Add the a custom toolbar buttons, which fires the above
+					// command..
+					editor.ui.addButton( 'MyButton',
+						{
+							label : 'insertHtml',
+							command : 'myDialogCmd'
+						} );
+				});
+		}
+	</script>
+</head>
+<body>
+<pre>
+=== Test insertHtml from dialog ===
+ 1. Set cursor in the middle of text in edit area.
+ 1. Press insertHtml button, enter some text and press OK.
+ * Expected result: text is inserted in the cursor current position, with the same style.
+ </pre>
+<textarea cols="80" id="editor1" name="editor1" rows="5">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+</body>
+</html>
