From 4ceab83fd024405dfa43e10241bb9a9f7fee5bf5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 1 Dec 2008 22:55:39 +0100 Subject: Better creation of section IDs FS#1536 This patch enhances the creation of section IDs for number only headlines. It also moves section ID creation to a function in pageutils.php removing some duplicate functionality in inc/action.php darcs-hash:20081201215539-7ad00-48f3c153a2c126d9fb06aa90e4f1b857f76ebec7.gz --- inc/parser/xhtml.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 4fb6cb548..fda1ef36e 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -1004,21 +1004,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { * @author Andreas Gohr */ function _headerToLink($title,$create=false) { - $title = str_replace(':','',cleanID($title)); - $title = ltrim($title,'0123456789._-'); - if(empty($title)) $title='section'; - if($create){ - // make sure tiles are unique - $num = ''; - while(in_array($title.$num,$this->headers)){ - ($num) ? $num++ : $num = 1; - } - $title = $title.$num; - $this->headers[] = $title; + return sectionID($title,$this->headers); + }else{ + return sectionID($title); } - - return $title; } /** -- cgit v1.2.3