diff options
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/xhtml.php | 81 |
1 files changed, 9 insertions, 72 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index de7893061..d9e3e784e 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -32,7 +32,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $headers = array(); var $footnotes = array(); - var $pnid = 0; var $lastlevel = 0; var $node = array(0,0,0,0,0); var $store = ''; @@ -94,10 +93,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // make sure there are no empty paragraphs $this->doc = preg_replace('#<p>\s*</p>#','',$this->doc); - if ($conf['purplenumbers']) { - $this->doc = preg_replace('#<p[^>]*>\s*<!--PN-->.*?(?:</p>)#','',$this->doc); - $this->doc = preg_replace('/<!--PN-->/','',$this->doc); - } } function toc_additem($id, $text, $level) { @@ -110,8 +105,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function header($text, $level, $pos) { - global $conf; - global $lang; if(!$text) return; //skip empty headlines $hid = $this->_headerToLink($text,true); @@ -126,15 +119,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $this->node[$this->lastlevel-$i-1] = 0; } } - $this->pnid = 0; $this->lastlevel = $level; // write the header $this->doc .= DOKU_LF.'<h'.$level.'><a name="'.$hid.'" id="'.$hid.'">'; $this->doc .= $this->_xmlEntities($text); - $this->doc .= "</a>"; - if ($conf['purplenumbers']) $this->doc .= " <a href='#$hid' class='pn' title='".$lang['sectionlink']."'>§</a>"; - $this->doc .= "</h$level>".DOKU_LF; + $this->doc .= "</a></h$level>".DOKU_LF; } /** @@ -166,11 +156,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function p_open() { - $this->doc .= DOKU_LF.'<p'.$this->_getPurpleNumberID().'>'.DOKU_LF; + $this->doc .= DOKU_LF.'<p>'.DOKU_LF; } function p_close() { - $this->doc .= DOKU_LF.$this->_getPurpleNumberLink().'</p>'.DOKU_LF; + $this->doc .= DOKU_LF.'</p>'.DOKU_LF; } function linebreak() { @@ -303,7 +293,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function listitem_open($level) { - $this->doc .= '<li class="level'.$level.'"'.$this->_getPurpleNumberID().'>'; + $this->doc .= '<li class="level'.$level.'">'; } function listitem_close() { @@ -315,7 +305,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function listcontent_close() { - $this->doc .= $this->_getPurpleNumberLink().'</div>'.DOKU_LF; + $this->doc .= '</div>'.DOKU_LF; } function unformatted($text) { @@ -368,11 +358,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } function preformatted($text) { - $this->doc .= '<pre class="code"'.$this->_getPurpleNumberID().'>' . trim($this->_xmlEntities($text)) . $this->_getPurpleNumberLink(). '</pre>'. DOKU_LF; + $this->doc .= '<pre class="code">' . trim($this->_xmlEntities($text)) . '</pre>'. DOKU_LF; } function file($text) { - $this->doc .= '<pre class="file"'.$this->_getPurpleNumberID().'>' . trim($this->_xmlEntities($text)). $this->_getPurpleNumberLink(). '</pre>'. DOKU_LF; + $this->doc .= '<pre class="file">' . trim($this->_xmlEntities($text)). '</pre>'. DOKU_LF; } function quote_open() { @@ -832,11 +822,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function table_open($maxcols = NULL, $numrows = NULL){ // initialize the row counter used for classes $this->_counter['row_counter'] = 0; - $this->doc .= '<table class="inline"'.$this->_getPurpleNumberID().'>'.DOKU_LF; + $this->doc .= '<table class="inline">'.DOKU_LF; } function table_close(){ - $this->doc .= '</table>'.$this->_getPurpleNumberLink(1).DOKU_LF; + $this->doc .= '</table>'.DOKU_LF; } function tablerow_open(){ @@ -1105,59 +1095,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { return $link; } - /** - * Builds unique Hierarchical ID: - * If $conf['purplenumbers'] is 2, it is unique per site, - * otherwise it is unique per page. - * - * @author Anika Henke <anika@selfthinker.org> - */ - function _getHID($noprefix=0) { - global $conf; - if ($noprefix) { - $prefix = ''; - } else if ($conf['purplenumbers']==2) { - global $ID; - $prefix = $ID.'.'; - } else { - $prefix = 'HID'; - } - return $prefix.preg_replace('/(\.0)*$/','',join('.',$this->node)).str_replace(':0','',':'.$this->pnid); - } - - /** - * Equips each designated element with a Purple Number (Hierarchical ID). - * - * @author Anika Henke <anika@selfthinker.org> - */ - function _getPurpleNumberID() { - global $conf; - $this->pnid++; - if ($conf['purplenumbers']) { - return ' id="'.$this->_getHID().'"'; - } - return ''; - } - - /** - * Creates a link to the current Purple Number (Hierarchical ID). - * If the link cannot be inside its corresponding element (e.g. tables), - * $outside is set and p.pnlink is added around the link. - * - * @author Anika Henke <anika@selfthinker.org> - */ - function _getPurpleNumberLink($outside=0) { - global $conf; - if ($conf['purplenumbers']) { - global $lang; - $pnlink = '<a href="#'.$this->_getHID().'" class="pn" title="'.$lang['sectionlink'].'">¶</a>'; - if ($outside) { - return '<p class="pnlink">'.$pnlink.'</p>'; - } - return ' <!--PN-->'.$pnlink; - } - return ''; - } } |