includes/namespaces/default.php
changeset 1343 2a31905a567d
parent 1332 12286b3ee214
--- a/includes/namespaces/default.php	Thu Jun 02 05:24:38 2011 -0400
+++ b/includes/namespaces/default.php	Thu Jun 02 05:28:28 2011 -0400
@@ -426,16 +426,21 @@
 		
 		if ( $incl_inner_headers )
 		{
-			if ( $page_format === 'wikitext' )
+			if ( $page_format === 'wikitext' || !function_exists("render_text_{$page_format}") )
 			{
 				$text = '?>' . RenderMan::render($text);
 			}
 			else
 			{
+				$result = call_user_func("render_text_{$page_format}", $text);
+				if ( is_string($result) )
+				{
+					$text = $result;
+					unset($result);
+				}
 				// Page format is XHTML. This means we want to disable functionality that MCE takes care of, while still retaining
 				// the ability to wikilink, the ability to use images, etc. Basically, RENDER_INLINEONLY disables all behavior in
 				// the rendering engine/Text_Wiki that conflicts with MCE.
-				$text = '?>' . RenderMan::render($text, RENDER_INLINE);
 			}
 		}
 		else