--- dokuwiki-2011-05-25a/inc/parser/xhtml.php 2011-06-15 07:58:54.000000000 +1200 +++ dokuwiki/inc/parser/xhtml.php 2012-01-23 13:16:49.317187175 +1300 @@ -170,6 +170,12 @@ } $this->lastlevel = $level; + // Hide the 'reset' header + if ($text == '#') + { + return; + } + if ($level <= $conf['maxseclevel'] && count($this->sectionedits) > 0 && $this->sectionedits[count($this->sectionedits) - 1][2] === 'section') { @@ -449,19 +449,24 @@ $text = substr($text, 0, -1); } + // - code HTML is now temporarily stored in a local string so we can + // restore specific HTML comments [jmt12] + $code_text = ''; if ( is_null($language) ) { - $this->doc .= '
'.$this->_xmlEntities($text).'
'.DOKU_LF; + $code_text = '
'.$this->_xmlEntities($text).'
'.DOKU_LF; // [jmt12] } else { $class = 'code'; //we always need the code class to make the syntax highlighting apply if($type != 'code') $class .= ' '.$type; - $this->doc .= "
".p_xhtml_cached_geshi($text, $language, '').'
'.DOKU_LF; + $code_text = "
".p_xhtml_cached_geshi($text, $language, '').'
'.DOKU_LF; // [jmt12] } + // - restore id comments! [jmt12] + $code_text = preg_replace('/\<\;\!\-\-\s+id\:([^\s]+)\s+\-\-\>\;/','', $code_text); + $this->doc .= $code_text; // [jmt12] if($filename){ $this->doc .= ''.DOKU_LF; } $this->_codeblock++; } @@ -665,6 +670,16 @@ $class='media'; } + // [jmt12] Replace the macro ~~localhost~~ with the hostname (and port + // number if necessary) of the current host + if (preg_match('/^http:\/\/~~baseurl~~(\/.*)$/', $url, $matches)) + { + $host = $_SERVER['HTTP_HOST']; + $path = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/')); + $url = 'http://' . $host . $path . $matches[1]; + } + // [jmt12] + //prepare for formating $link['target'] = $conf['target']['extern']; $link['style'] = '';