Experimental support for WikiHiero
authorMr. E23 <e23@users.mediawiki.org>
Fri, 26 Mar 2004 19:02:24 +0000 (19:02 +0000)
committerMr. E23 <e23@users.mediawiki.org>
Fri, 26 Mar 2004 19:02:24 +0000 (19:02 +0000)
includes/DefaultSettings.php
includes/Parser.php

index 9b9bcd0..cb7123f 100644 (file)
@@ -202,6 +202,12 @@ $wgWLCacheTimeout = 3600;  # The hour or so mentioned above
 $wgUseTeX = false;
 $wgTexvc = "./math/texvc"; # Location of the texvc binary
 
+# Support for inline hieroglyphs, see http://aoineko.free.fr/ The
+# WikiHiero php files must be present in the same directory as the
+# rest of the mediawiki code, and WikiHiero must have been configured
+# with the correct image locations.
+$wgUseWikiHiero = false;
+
 # Profiling / debugging
 $wgProfiling = false; # Enable for more detailed by-function times in debug log
 $wgProfileLimit = 0.0; # Only record profiling info for pages that took longer than this
index c9b445c..d6fca64 100644 (file)
@@ -2,6 +2,10 @@
 
 include_once('Tokenizer.php');
 
+if( $GLOBALS['wgUseWikiHiero'] ){
+       include_once('wikihiero.php');
+}
+
 # PHP Parser 
 # 
 # Processes wiki markup
@@ -147,6 +151,16 @@ class Parser
                        }
                }
 
+               if( $GLOBALS['wgUseWikiHiero'] ){
+                       $text = Parser::extractTags("hiero", $text, $hiero_content, $uniq_prefix);
+                       foreach( $hiero_content as $marker => $content ){
+                               if( $render ){
+                                       $hiero_content[$marker] = WikiHiero( $content, WH_MODE_HTML);
+                               } else {
+                                       $hiero_content[$marker] = "<hiero>$content</hiero>";
+                               }
+                       }
+               }
 
                if( $this->mOptions->getUseTeX() ){
                        $text = Parser::extractTags("math", $text, $math_content, $uniq_prefix);
@@ -168,7 +182,7 @@ class Parser
                        }
                }
 
-               $state = array( $nowiki_content, $math_content, $pre_content );
+               $state = array( $nowiki_content, $hiero_content, $math_content, $pre_content );
                
                return $text;
        }
@@ -1077,7 +1091,6 @@ class Parser
        {
                global $wgVariableIDs;
                $this->mVariables = array();
-
                foreach ( $wgVariableIDs as $id ) {
                        $mw =& MagicWord::get( $id );
                        $mw->addToArray( $this->mVariables, $this->getVariableValue( $id ) );