Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditorParser.body.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditorParser.body.php	(revision 600)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditorParser.body.php	(revision 601)
@@ -170,4 +170,19 @@
     }
 
+    function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) {
+        $parserOutput = parent::parse($text, &$title, $options, $linestart , $clearState , $revid );
+        
+        $categories = $parserOutput->getCategories();
+        if ($categories) {
+            $appendString = "";
+            foreach ($categories as $cat=>$val) {
+                $appendString .= "<a href=\"Category:" . $cat ."\">Category:" . $cat ."</a> ";
+            }
+            $parserOutput->setText($parserOutput->getText() . $appendString);
+        }                
+        
+        return $parserOutput;
+    }
+    
     /*
     function replaceVariables( $text, $args = array(), $argsOnly = false ) {
Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditorSajax.body.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditorSajax.body.php	(revision 600)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditorSajax.body.php	(revision 601)
@@ -75,7 +75,20 @@
 {
     global $wgContLang, $wgOut;
-    $limit = 10;
-
+    $limit = 10;    
+    $ns = NS_MAIN;
+    
     $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) );
+    
+    if (strpos($term, "Category:") === 0) {
+        $ns = NS_CATEGORY;
+        $term = substr($term, 9);
+        $prefix = "Category:";
+    }
+    else if (strpos($term, ":Category:") === 0) {
+        $ns = NS_CATEGORY;
+        $term = substr($term, 10);        
+        $prefix = ":Category:";
+    }
+    
     $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) );
     $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) );
@@ -83,10 +96,11 @@
     $term = $term1;
 
-    if ( strlen( str_replace( '_', '', $term ) )<3 )
-    return "";
+    if ( strlen( str_replace( '_', '', $term ) )<3 ) {
+        return "";
+    }
 
     $db =& wfGetDB( DB_SLAVE );
     $res = $db->select( 'page', 'page_title',
-    array(  'page_namespace' => NS_MAIN,
+    array(  'page_namespace' => $ns,
     "LCASE(page_title) LIKE '%". $db->strencode( $term2 ) ."%'" ),
     "wfSajaxSearch",
@@ -97,4 +111,7 @@
     $i=0;
     while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {
+        if (!is_null($prefix)) {
+            $ret .= $prefix;
+        }
         $ret .= $row->page_title ."\n";
     }
Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditorSkin.body.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditorSkin.body.php	(revision 600)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditorSkin.body.php	(revision 601)
@@ -123,4 +123,8 @@
             $text = htmlspecialchars( $nt->getPrefixedText() );
         }
+        
+        if ($nt->getNamespace() == NS_CATEGORY) {
+            $u = ':' . $u;
+        }
 
         list( $inside, $trail ) = Linker::splitTrail( $trail );
@@ -141,12 +145,11 @@
         wfProfileIn( $fname );
 
-        //$u = $nt->escapeLocalURL( $query );
-        //$u = $nt->getText();
-        //$u = $nt->getEscapedText();
         $u = $nt->getFullText();
-        //print_r($nt);
 
         if ( '' == $text ) {
             $text = htmlspecialchars( $nt->getPrefixedText() );
+        }
+        if ($nt->getNamespace() == NS_CATEGORY) {
+            $u = ':' . $u;
         }
 
