Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.body.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.body.php	(revision 507)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.body.php	(revision 508)
@@ -287,5 +287,34 @@
     }    
 } 
+function showSource() {
+    var wp = document.getElementById("wpDiff");
+    var s = document.createElement("input");
+    s.type="submit";
+    s.value="Wiki2HTML";
+    s.name="Wiki2HTML";
+    s.onclick = function wiki2html() {
+        var oEditor = FCKeditorAPI.GetInstance('wpTextbox1');        
+        WikiToHTML_Call();        
+        return false;
+    }
+    wp.parentNode.insertBefore(s, wp.nextSibling);
+}
+
+var sajax_debug_mode = false;
+var sajax_request_type = "GET";
+
+function WikiToHTML_Result(result)
+{
+    var oEditor = FCKeditorAPI.GetInstance('wpTextbox1');        
+    oEditor.SetHTML(result.responseText);
+}
+function WikiToHTML_Call()
+{
+     var oEditor = FCKeditorAPI.GetInstance('wpTextbox1');        
+     sajax_do_call('wfSajaxWikiToHTML', [oEditor.GetHTML()], WikiToHTML_Result); 
+}
+
 addOnloadHook(onLoadFCK);
+addOnloadHook(showSource);
 </script>        
 HEREDOC;
@@ -348,4 +377,17 @@
 
     return "  <input type=\"hidden\" name=\"wfSajaxSearchImageFCKeditor\" value=\"\"><br />Images containing <b>\"".$term2."\"</b><br /><ul>" .$r ."</ul>";
+}
+
+function wfSajaxWikiToHTML( $wiki )
+{
+        global $wgOut, $wgTitle, $wgScriptPath;
+        global $wgFCKEditorToolbarSet;
+        global $wgFCKEditorDir, $wgFCKEditorHeight, $wgUser;
+        
+        $options = new FCKeditorParserOptions();
+        $options->setTidy(true);
+        $parser = new FCKeditorParser();
+        $parser->setOutputType(OT_HTML);
+        return $parser->parse($wiki, $wgTitle, $options)->getText();
 }
 
Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.php	(revision 507)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.php	(revision 508)
@@ -45,4 +45,5 @@
 $wgUseAjax = true;
 $wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor';
+$wgAjaxExportList[] = 'wfSajaxWikiToHTML';
 
 $wgExtensionCredits['other'][] = array(
