diff options
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/code.php | 2 | ||||
-rw-r--r-- | inc/parser/metadata.php | 41 | ||||
-rw-r--r-- | inc/parser/parser.php | 12 | ||||
-rw-r--r-- | inc/parser/renderer.php | 11 | ||||
-rw-r--r-- | inc/parser/xhtml.php | 8 |
5 files changed, 22 insertions, 52 deletions
diff --git a/inc/parser/code.php b/inc/parser/code.php index ff44a4e1e..21fb0dc3c 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -19,7 +19,7 @@ class Doku_Renderer_code extends Doku_Renderer { global $INPUT; if(!$language) $language = 'txt'; if(!$filename) $filename = 'snippet.'.$language; - $filename = basename($filename); + $filename = utf8_basename($filename); if($this->_codeblock == $INPUT->str('codeblock')){ header("Content-Type: text/plain; charset=utf-8"); diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 8bfdc3b9c..8638ffa6a 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -133,27 +133,6 @@ class Doku_Renderer_metadata extends Doku_Renderer { } } - function strong_open(){} - function strong_close(){} - - function emphasis_open(){} - function emphasis_close(){} - - function underline_open(){} - function underline_close(){} - - function monospace_open(){} - function monospace_close(){} - - function subscript_open(){} - function subscript_close(){} - - function superscript_open(){} - function superscript_close(){} - - function deleted_open(){} - function deleted_close(){} - /** * Callback for footnote start syntax * @@ -218,14 +197,6 @@ class Doku_Renderer_metadata extends Doku_Renderer { if ($this->capture) $this->doc .= $text; } - function php($text){} - - function phpblock($text){} - - function html($text){} - - function htmlblock($text){} - function preformatted($text){ if ($this->capture) $this->doc .= $text; } @@ -393,18 +364,6 @@ class Doku_Renderer_metadata extends Doku_Renderer { $params['refresh']; } - function table_open($maxcols = NULL, $numrows = NULL){} - function table_close(){} - - function tablerow_open(){} - function tablerow_close(){} - - function tableheader_open($colspan = 1, $align = NULL, $rowspan = 1){} - function tableheader_close(){} - - function tablecell_open($colspan = 1, $align = NULL, $rowspan = 1){} - function tablecell_close(){} - //---------------------------------------------------------- // Utils diff --git a/inc/parser/parser.php b/inc/parser/parser.php index cf132ce97..915899f53 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -52,6 +52,9 @@ class Doku_Parser { var $Handler; + /** + * @var Doku_Lexer $Lexer + */ var $Lexer; var $modes = array(); @@ -59,11 +62,11 @@ class Doku_Parser { var $connected = false; function addBaseMode(& $BaseMode) { - $this->modes['base'] = & $BaseMode; + $this->modes['base'] =& $BaseMode; if ( !$this->Lexer ) { $this->Lexer = new Doku_Lexer($this->Handler,'base', true); } - $this->modes['base']->Lexer = & $this->Lexer; + $this->modes['base']->Lexer =& $this->Lexer; } /** @@ -75,7 +78,7 @@ class Doku_Parser { $this->addBaseMode(new Doku_Parser_Mode_base()); } $Mode->Lexer = & $this->Lexer; - $this->modes[$name] = & $Mode; + $this->modes[$name] =& $Mode; } function connectModes() { @@ -134,6 +137,9 @@ class Doku_Parser { */ class Doku_Parser_Mode { + /** + * @var Doku_Lexer $Lexer + */ var $Lexer; var $allowedModes = array(); diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 7002fd0cb..7df369478 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -20,6 +20,8 @@ class Doku_Renderer extends DokuWiki_Plugin { 'toc' => true, // render the TOC? ); + var $doc = ''; + // keep some config options var $acronyms = array(); var $smileys = array(); @@ -60,7 +62,7 @@ class Doku_Renderer extends DokuWiki_Plugin { //handle plugin rendering function plugin($name,$data){ - $plugin =& plugin_load('syntax',$name); + $plugin = plugin_load('syntax',$name); if($plugin != null){ $plugin->render($this->getFormat(),$this,$data); } @@ -75,7 +77,7 @@ class Doku_Renderer extends DokuWiki_Plugin { foreach ( $instructions as $instruction ) { // execute the callback against ourself if (method_exists($this,$instruction[0])) { - call_user_func_array(array($this, $instruction[0]),$instruction[1]); + call_user_func_array(array($this, $instruction[0]), $instruction[1] ? $instruction[1] : array()); } } } @@ -272,9 +274,10 @@ class Doku_Renderer extends DokuWiki_Plugin { list($name,$hash) = explode('#',$name,2); if($hash) return $hash; - $name = strtr($name,';',':'); if($conf['useslash']){ - $name = strtr($name,'/',':'); + $name = strtr($name,';/',';:'); + }else{ + $name = strtr($name,';',':'); } return noNSorNS($name); diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 2f09dbd4f..b4e78a530 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -358,6 +358,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { /** * Execute PHP code if allowed * + * @param string $text PHP code that is either executed or printed * @param string $wrapper html element to wrap result if $conf['phpok'] is okff * * @author Andreas Gohr <andi@splitbrain.org> @@ -382,6 +383,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { /** * Insert HTML if allowed * + * @param string $text html text * @param string $wrapper html element to wrap result if $conf['htmlok'] is okff * * @author Andreas Gohr <andi@splitbrain.org> @@ -1067,7 +1069,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // return the title of the picture if (!$title) { // just show the sourcename - $title = $this->_xmlEntities(basename(noNS($src))); + $title = $this->_xmlEntities(utf8_basename(noNS($src))); } return $title; } @@ -1096,7 +1098,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // return the title of the flash if (!$title) { // just show the sourcename - $title = basename(noNS($src)); + $title = utf8_basename(noNS($src)); } return $this->_xmlEntities($title); } @@ -1115,7 +1117,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $ret .= $this->_xmlEntities($title); }else{ // just show the sourcename - $ret .= $this->_xmlEntities(basename(noNS($src))); + $ret .= $this->_xmlEntities(utf8_basename(noNS($src))); } return $ret; |