Index: /MediaWiki/trunk/FCKeditor.php
===================================================================
--- /MediaWiki/trunk/FCKeditor.php	(revision 1833)
+++ /MediaWiki/trunk/FCKeditor.php	(revision 1834)
@@ -69,4 +69,5 @@
 $wgAjaxExportList[] = 'wfSajaxGetMathUrl';
 $wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor';
+$wgAjaxExportList[] = 'wfSajaxSearchSpecialTagFCKeditor';
 
 $wgExtensionCredits['other'][] = array(
Index: /MediaWiki/trunk/FCKeditorParser.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditorParser.body.php	(revision 1833)
+++ /MediaWiki/trunk/FCKeditorParser.body.php	(revision 1834)
@@ -47,5 +47,5 @@
 		$key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw';
 		$this->fck_mw_strtr_span_counter++;
-		$this->fck_mw_strtr_span[$key] = $text;
+		$this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text);
 		return $key;
 	}
@@ -59,9 +59,16 @@
 	*/
 	function fck_genericTagHook( $str, $argv, $parser ) {
+		if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) {
+			$class = $this->fck_mw_taghook;
+		}
+		else {
+			$class = "special";
+		}
+		
 		if (empty($argv)) {
-			$ret = "<span class=\"fck_mw_".$this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";
+			$ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";
 		}
 		else {
-			$ret = "<span class=\"fck_mw_".$this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";
+			$ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";
 			foreach ($argv as $key=>$value) {
 				$ret .= " ".$key."=\"".$value."\"";
@@ -91,8 +98,8 @@
 	function fck_wikiTag( $tagName, $str, $argv = array()) {
 		if (empty($argv)) {
-			$ret = "<span class=\"fck_mw_".$tagName."\">";
+			$ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
 		}
 		else {
-			$ret = "<span class=\"fck_mw_".$tagName."\"";
+			$ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
 			foreach ($argv as $key=>$value) {
 				$ret .= " ".$key."=\"".$value."\"";
Index: /MediaWiki/trunk/FCKeditorSajax.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditorSajax.body.php	(revision 1833)
+++ /MediaWiki/trunk/FCKeditorSajax.body.php	(revision 1834)
@@ -37,4 +37,17 @@
 
 	return $url;
+}
+
+function wfSajaxSearchSpecialTagFCKeditor($empty)
+{
+	global $wgParser;
+
+	$ret = "nowiki\nincludeonly\nonlyinclude\nnoinclude\n";
+	foreach ($wgParser->getTags() as $h) {
+		if (!in_array($h, array("pre", "math", "ref", "references"))) {
+			$ret .= $h ."\n";
+		}
+	}
+	return $ret;
 }
 
Index: /MediaWiki/trunk/fckeditor_config.js
===================================================================
--- /MediaWiki/trunk/fckeditor_config.js	(revision 1833)
+++ /MediaWiki/trunk/fckeditor_config.js	(revision 1834)
@@ -13,5 +13,5 @@
 	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
 	['SpecialChar','Table','Image','Rule'],
-	['MW_Template','MW_Ref','MW_Math'],
+	['MW_Template','MW_Special','MW_Ref','MW_Math'],
 	'/',
 	['FontFormat'],
@@ -37,33 +37,58 @@
 
 FCKConfig.EditorAreaStyles = '\
-.FCK__MWTemplate \
+.FCK__MWTemplate, .FCK__MWRef, .FCK__MWSpecial, .FCK__MWReferences, .FCK__MWNowiki, .FCK__MWIncludeonly, .FCK__MWNoinclude, .FCK__MWOnlyinclude \
 { \
 	border: 1px dotted #00F; \
 	background-position: center center; \
+	background-repeat: no-repeat; \
+	vertical-align: middle; \
+} \
+.FCK__MWTemplate, \
+{ \
 	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_template.gif); \
-	background-repeat: no-repeat; \
 	width: 20px; \
 	height: 15px; \
-	vertical-align: middle; \
 } \
 .FCK__MWRef \
 { \
-	border: 1px dotted #00F; \
-	background-position: center center; \
 	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_ref.gif); \
-	background-repeat: no-repeat; \
 	width: 18px; \
 	height: 15px; \
-	vertical-align: middle; \
+} \
+.FCK__MWSpecial \
+{ \
+	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_special.gif); \
+	width: 66px; \
+	height: 15px; \
+} \
+.FCK__MWNowiki \
+{ \
+	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_nowiki.gif); \
+	width: 66px; \
+	height: 15px; \
+} \
+.FCK__MWIncludeonly \
+{ \
+	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_includeonly.gif); \
+	width: 66px; \
+	height: 15px; \
+} \
+.FCK__MWNoinclude \
+{ \
+	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_noinclude.gif); \
+	width: 66px; \
+	height: 15px; \
+} \
+.FCK__MWOnlyinclude \
+{ \
+	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_onlyinclude.gif); \
+	width: 66px; \
+	height: 15px; \
 } \
 .FCK__MWReferences \
 { \
-	border: 1px dotted #00F; \
-	background-position: center center; \
 	background-image: url(' + FCKConfig.PluginsPath + 'mediawiki/images/icon_references.gif); \
-	background-repeat: no-repeat; \
 	width: 66px; \
 	height: 15px; \
-	vertical-align: middle; \
 } \
 ' ;
Index: /MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php
===================================================================
--- /MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php	(revision 1833)
+++ /MediaWiki/trunk/mw12/FCKeditorParser_OldPP.body.php	(revision 1834)
@@ -47,5 +47,5 @@
 		$key = 'Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw';
 		$this->fck_mw_strtr_span_counter++;
-		$this->fck_mw_strtr_span[$key] = $text;
+		$this->fck_mw_strtr_span[$key] = str_replace(array("\r\n", "\n", "\r"),"fckLR",$text);
 		return $key;
 	}
@@ -59,9 +59,16 @@
 	*/
 	function fck_genericTagHook( $str, $argv, $parser ) {
+		if (in_array($this->fck_mw_taghook, array("ref", "math", "references"))) {
+			$class = $this->fck_mw_taghook;
+		}
+		else {
+			$class = "special";
+		}
+		
 		if (empty($argv)) {
-			$ret = "<span class=\"fck_mw_".$this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";
+			$ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\">";
 		}
 		else {
-			$ret = "<span class=\"fck_mw_".$this->fck_mw_taghook."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";
+			$ret = "<span class=\"fck_mw_".$class."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$this->fck_mw_taghook."\"";
 			foreach ($argv as $key=>$value) {
 				$ret .= " ".$key."=\"".$value."\"";
@@ -91,8 +98,8 @@
 	function fck_wikiTag( $tagName, $str, $argv = array()) {
 		if (empty($argv)) {
-			$ret = "<span class=\"fck_mw_".$tagName."\">";
+			$ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
 		}
 		else {
-			$ret = "<span class=\"fck_mw_".$tagName."\"";
+			$ret = "<span class=\"fck_mw_".$tagName."\" _fck_mw_customtag=\"true\" _fck_mw_tagname=\"".$tagName."\">";
 			foreach ($argv as $key=>$value) {
 				$ret .= " ".$key."=\"".$value."\"";
Index: /MediaWiki/trunk/plugins/mediawiki/fckplugin.js
===================================================================
--- /MediaWiki/trunk/plugins/mediawiki/fckplugin.js	(revision 1833)
+++ /MediaWiki/trunk/plugins/mediawiki/fckplugin.js	(revision 1834)
@@ -45,10 +45,16 @@
 FCKToolbarItems.RegisterItem( 'MW_Math', tbButton ) ;
 
+tbButton = new FCKToolbarButton( 'MW_Special', 'Special Tag', 'Insert/Edit Special Tag' ) ;
+tbButton.IconPath = FCKConfig.PluginsPath + 'mediawiki/images/tb_icon_special.gif' ;
+FCKToolbarItems.RegisterItem( 'MW_Special', tbButton ) ;
+
 // Override some dialogs.
 FCKCommands.RegisterCommand( 'MW_Template', new FCKDialogCommand( 'MW_Template', 'Template Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/template.html', 400, 330 ) ) ;
 FCKCommands.RegisterCommand( 'MW_Ref', new FCKDialogCommand( 'MW_Ref', 'Reference Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/ref.html', 400, 250 ) ) ;
 FCKCommands.RegisterCommand( 'MW_Math', new FCKDialogCommand( 'MW_Math', 'Formula', FCKConfig.PluginsPath + 'mediawiki/dialogs/math.html', 400, 300 ) ) ;
+FCKCommands.RegisterCommand( 'MW_Special', new FCKDialogCommand( 'MW_Special', 'Special Tag Properties', FCKConfig.PluginsPath + 'mediawiki/dialogs/special.html', 400, 330 ) ) ; //YC
 FCKCommands.RegisterCommand( 'Link', new FCKDialogCommand( 'Link', FCKLang.DlgLnkWindowTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/link.html', 400, 250 ) ) ;
 FCKCommands.RegisterCommand( 'Image', new FCKDialogCommand( 'Image', FCKLang.DlgImgTitle, FCKConfig.PluginsPath + 'mediawiki/dialogs/image.html', 450, 300 ) ) ;
+
 
 // MediaWiki Wikitext Data Processor implementation.
@@ -452,4 +458,5 @@
 								case 'fck_mw_onlyinclude' :
 									sNodeName = 'onlyinclude' ;
+									
 									break ;
 							}
@@ -517,8 +524,9 @@
 				var parentIsSpecialTag = htmlNode.parentNode.getAttribute( '_fck_mw_customtag' ) ; 
 				var textValue = htmlNode.nodeValue;
-
+	
 				if ( !parentIsSpecialTag ) 
 				{
 					textValue = textValue.replace( /[\n\t]/g, ' ' ) ; 
+	
 					textValue = FCKTools.HTMLEncode( textValue ) ;
 					textValue = textValue.replace( /\u00A0/g, '&nbsp;' ) ;
@@ -537,14 +545,12 @@
 					if ( this._inLSpace && textValue.length == 1 && textValue.charCodeAt(0) == 13 )
 						textValue = textValue + " " ;
-					
 					if ( this._IsInsideCell )
 						textValue = textValue.replace( /\|/g, '&#124;' ) ;
-
 				}
 				else 
-				{
-					textValue = FCKTools.HTMLDecode( textValue ) ;
+				{					
+					textValue = FCKTools.HTMLDecode(textValue).replace(/fckLR/g,'\r\n');
 				}
-
+				
 				stringBuilder.push( textValue ) ;
 				return ;
@@ -676,8 +682,32 @@
 					className = 'FCK__MWReferences' ;
 			case 'fck_mw_template' :
+				if ( className == null ) //YC
+					className = 'FCK__MWTemplate' ; //YC
 			case 'fck_mw_magic' :
 				if ( className == null )
-					className = 'FCK__MWTemplate' ;
-
+					className = 'FCK__MWMagicWord' ;
+			case 'fck_mw_magic' :
+				if ( className == null )
+					className = 'FCK__MWMagicWord' ;
+			case 'fck_mw_special' : //YC
+				if ( className == null )
+					className = 'FCK__MWSpecial' ;
+			case 'fck_mw_nowiki' :
+				if ( className == null )
+					//className = 'FCK__MWSpecial' ;
+					className = 'FCK__MWNowiki' ;
+			case 'fck_mw_includeonly' :
+				if ( className == null )
+					//className = 'FCK__MWSpecial' ;
+					className = 'FCK__MWIncludeonly' ;
+			case 'fck_mw_noinclude' :
+				if ( className == null )
+					//className = 'FCK__MWSpecial' ;
+					className = 'FCK__MWNoinclude' ;
+			case 'fck_mw_onlyinclude' :
+				if ( className == null )
+					//className = 'FCK__MWSpecial' ;
+					className = 'FCK__MWOnlyinclude' ;
+					
 				var oImg = FCKDocumentProcessor_CreateFakeImage( className, eSpan.cloneNode(true) ) ;
 				oImg.setAttribute( '_' + eSpan.className, 'true', 0 ) ;
@@ -716,4 +746,9 @@
 				contextMenu.AddItem( 'MW_Math', 'Edit Formula' ) ;
 			}
+			if ( tag.getAttribute( '_fck_mw_special' ) || tag.getAttribute( '_fck_mw_nowiki' ) || tag.getAttribute( '_fck_mw_includeonly' ) || tag.getAttribute( '_fck_mw_noinclude' ) || tag.getAttribute( '_fck_mw_onlyinclude' )) //YC
+			{
+				contextMenu.AddSeparator() ;
+				contextMenu.AddItem( 'MW_Special', 'Special Tag Properties' ) ;
+			}
 		}
 	}
