Index: /MediaWiki/trunk/FCKeditor.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditor.body.php	(revision 3228)
+++ /MediaWiki/trunk/FCKeditor.body.php	(revision 3229)
@@ -133,4 +133,9 @@
 	}
 
+	public function onParserBeforeStrip(&$parser, &$text, &$stripState) {
+		$text = $parser->strip( $text, $stripState );
+		return true;
+	}
+
 	public function onSanitizerAfterFixTagAttributes($text, $element, &$attribs) {
 		$text = preg_match_all("/Fckmw\d+fckmw/", $text, $matches);
@@ -149,5 +154,5 @@
 
 	public function registerHooks() {
-		global $wgHooks, $wgExtensionFunctions;
+		global $wgHooks, $wgExtensionFunctions, $wgVersion;
 
 		$wgHooks['UserToggles'][]                       = array($this, 'onUserToggles');
@@ -157,4 +162,7 @@
 		$wgHooks['EditPage::showEditForm:fields'][]		= array($this, 'onEditPageShowEditFormFields');
 		$wgHooks['EditPageBeforePreviewText'][]         = array($this, 'onEditPageBeforePreviewText');
+		if (version_compare("1.14alpha", $wgVersion, "<=")) {
+			$wgHooks['ParserBeforeStrip'][]             = array($this, 'onParserBeforeStrip');
+		}
 		$wgHooks['EditPagePreviewTextEnd'][]            = array($this, 'onEditPagePreviewTextEnd');
 		$wgHooks['CustomEditor'][]                      = array($this, 'onCustomEditor');
Index: /MediaWiki/trunk/FCKeditorParser.body.php
===================================================================
--- /MediaWiki/trunk/FCKeditorParser.body.php	(revision 3228)
+++ /MediaWiki/trunk/FCKeditorParser.body.php	(revision 3229)
@@ -144,5 +144,5 @@
 	 */
 	function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) {
-		global $wgContLang, $wgUseTeX, $wgScriptPath, $wgVersion;
+		global $wgContLang, $wgUseTeX, $wgScriptPath, $wgVersion, $wgHooks, $wgExtensionFunctions;
 
 		wfProfileIn( __METHOD__ );
@@ -157,4 +157,8 @@
 		array( 'nowiki', 'gallery', 'math' ),
 		array_keys( $this->mTagHooks ) );
+		if ((isset ($wgHooks['ParserFirstCallInit']) && (in_array('wfCite', $wgHooks['ParserFirstCallInit']) ))
+			|| (isset ($wgExtensionFunctions) && (in_array('wfCite', $wgExtensionFunctions) ))){
+			$elements = array_merge( $elements, array( 'ref', 'references' ) );
+		}
 		global $wgRawHtml;
 		if( $wgRawHtml ) {
@@ -168,4 +172,5 @@
 		}
 
+		$elements = array_unique($elements);
 		$matches = array();
 		if (version_compare("1.12", $wgVersion, ">")) {
@@ -191,4 +196,10 @@
 							$output = "$tag-->";
 						}
+						break;
+					case 'references':
+						$output = $this->fck_wikiTag('references', $content, $params);
+						break;
+					case 'ref':
+						$output = $this->fck_wikiTag('ref', $content, $params);
 						break;
 					case 'html':
