\s*
#', '', $this->doc); } /** * Add an item to the TOC * * @param string $id the hash link * @param string $text the text to display * @param int $level the nesting level */ function toc_additem($id, $text, $level) { global $conf; //handle TOC if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']) { $this->toc[] = html_mktocitem($id, $text, $level - $conf['toptoclevel'] + 1); } } /** * Render a heading * * @param string $text the text to display * @param int $level header level * @param int $pos byte position in the original source */ function header($text, $level, $pos) { global $conf; if(blank($text)) return; //skip empty headlines $hid = $this->_headerToLink($text, true); //only add items within configured levels $this->toc_additem($hid, $text, $level); // adjust $node to reflect hierarchy of levels $this->node[$level - 1]++; if($level < $this->lastlevel) { for($i = 0; $i < $this->lastlevel - $level; $i++) { $this->node[$this->lastlevel - $i - 1] = 0; } } $this->lastlevel = $level; if($level <= $conf['maxseclevel'] && count($this->sectionedits) > 0 && $this->sectionedits[count($this->sectionedits) - 1]['target'] === 'section' ) { $this->finishSectionEdit($pos - 1); } // write the header $this->doc .= DOKU_LF.''.DOKU_LF; } /** * Close a paragraph */ function p_close() { $this->doc .= DOKU_LF.'
'.DOKU_LF; } /** * Create a line break */ function linebreak() { $this->doc .= '';
}
/**
* Stop monospace formatting
*/
function monospace_close() {
$this->doc .= '
';
}
/**
* Start a subscript
*/
function subscript_open() {
$this->doc .= '';
}
/**
* Stop a subscript
*/
function subscript_close() {
$this->doc .= '';
}
/**
* Start a superscript
*/
function superscript_open() {
$this->doc .= '';
}
/**
* Stop a superscript
*/
function superscript_close() {
$this->doc .= '';
}
/**
* Start deleted (strike-through) formatting
*/
function deleted_open() {
$this->doc .= ''.DOKU_LF; } /** * Output preformatted text * * @param string $text */ function preformatted($text) { $this->doc .= ''.DOKU_LF; } /** * Stop a block quote */ function quote_close() { $this->doc .= '
'.trim($this->_xmlEntities($text), "\n\r").''.DOKU_LF; } /** * Display text as file content, optionally syntax highlighted * * @param string $text text to show * @param string $language programming language to use for syntax highlighting * @param string $filename file path label * @param array $options assoziative array with additional geshi options */ function file($text, $language = null, $filename = null, $options=null) { $this->_highlight('file', $text, $language, $filename, $options); } /** * Display text as code content, optionally syntax highlighted * * @param string $text text to show * @param string $language programming language to use for syntax highlighting * @param string $filename file path label * @param array $options assoziative array with additional geshi options */ function code($text, $language = null, $filename = null, $options=null) { $this->_highlight('code', $text, $language, $filename, $options); } /** * Use GeSHi to highlight language syntax in code and file blocks * * @author Andreas Gohr
'.$this->_xmlEntities($text).''.DOKU_LF; } 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, '', $options).''.DOKU_LF; } if($filename) { $this->doc .= '