Index: _source/plugins/fakecomment/plugin.js
===================================================================
--- _source/plugins/fakecomment/plugin.js	Fri Oct 16 01:36:56 CST 2009
+++ _source/plugins/fakecomment/plugin.js	Fri Oct 16 01:36:56 CST 2009
@@ -0,0 +1,106 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+/**
+ * @file Comment place holder plugin which create a fake object to represent HTML
+ * comments in certain patterns.
+ */
+
+CKEDITOR.plugins.add( 'fakecomment',
+{
+	requires  : [ 'htmldataprocessor','fakeobjects' ],
+	init : function( editor )
+	{
+		// Add the style that renders our placeholder.
+		editor.addCss(
+			'img.cke_comment' +
+			'{' +
+				'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/placeholder.gif' ) + ');' +
+			    '-webkit-background-size: 20px 20px;' +
+			    '-o-background-size: 20px 20px;' +
+//			    '-moz-background-size: 20px 20px;' +
+				'background-position: center center;' +
+				'background-repeat: no-repeat;' +
+				'width: 20px;' +
+				'vertical-align: middle;' +
+				'border: #999999 1px dotted;' +
+			'}' );
+	},
+
+	// There's currently no gurantee on registration order, this make sure
+	// the registration will come after the default ones in 'htmldataprocessor'.
+	afterInit : function( editor )
+	{
+		var dataProcessor = editor.dataProcessor,
+			dataFilter = dataProcessor.dataFilter,
+			htmlFilter = dataProcessor.htmlFilter,
+			commentFilters = htmlFilter._.comment,
+			filter = commentFilters.filter || commentFilters[ 0 ],
+			config = editor.config,
+			fakeComments = config.fakeComments,
+			fakeCommentName = config.fakeCommentName || 'cke:comment';
+
+		if( ! ( fakeComments && fakeComments.length ) )
+			return;
+
+		// Create fake objects for all fake comments.
+		dataFilter.addRules(
+			{
+				comment : function( value )
+				{
+					var data = filter( value ), fakeWrapper, fakeElement;
+
+					// Instance of CKEDITOR.htmlParser.cdata is expected.
+					if ( data.value )
+					{
+						for ( var i = 0; i < fakeComments.length; i++ )
+						{
+							// Is it actually a comment and contains the desired values?
+							data.value.replace( /<!--([\s\S]*?)-->/, function( match, content )
+							{
+								if( content.match( fakeComments[ i ] ) )
+								{
+									fakeWrapper = new CKEDITOR.htmlParser.element( fakeCommentName, {} );
+									fakeWrapper.add( data );
+									fakeElement = editor.createFakeParserElement( fakeWrapper, 'cke_comment', fakeCommentName, false );
+								}
+							} );
+
+							if ( fakeElement )
+								return fakeElement;
+						}
+					}
+					return value;
+				}
+			} );
+
+		// Reveal the comment in output data.
+		var rule = { elements : {} };
+		rule.elements[ fakeCommentName ] = function( element )
+		{
+			// Drop this wrapper element.
+			delete element.name;
+		};
+		htmlFilter.addRules( rule );
+	}
+} );
+
+/**
+ * A list of comment content value patterns which will be converted to fake element.
+ * @type Array
+ * @default Empty
+ * @example
+ * config.fakeComments = [ /^break$/ ];
+ */
+//CKEDITOR.config.fakeComments = [];
+
+/**
+ * Display name of the fake comment in editor.
+ * @type String
+ * @default 'cke:comment'
+ * @example
+ * config.fakeCommentName = 'comment';
+ */
+//CKEDITOR.config.fakeCommentName = 'cke:comment';

