summaryrefslogtreecommitdiff
path: root/inc/parser/xhtml.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-12-01 22:55:39 +0100
committerAndreas Gohr <andi@splitbrain.org>2008-12-01 22:55:39 +0100
commit4ceab83fd024405dfa43e10241bb9a9f7fee5bf5 (patch)
treeae76ea4ea79982aaed8e2dc251d8fd917e523b39 /inc/parser/xhtml.php
parent137ce95a340b36e962f90c44c9f6414dc2e0d1e4 (diff)
downloadrpg-4ceab83fd024405dfa43e10241bb9a9f7fee5bf5.tar.gz
rpg-4ceab83fd024405dfa43e10241bb9a9f7fee5bf5.tar.bz2
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
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r--inc/parser/xhtml.php16
1 files changed, 3 insertions, 13 deletions
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 <andi@splitbrain.org>
*/
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;
}
/**