Skip to content
Snippets Groups Projects
Commit 620f4930 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fix header links in metadata FS#1617

Ignore-this: b580164b5ba3eca3120bc35d8680c9fc

darcs-hash:20090410184955-7ad00-480cd8c07a994ca4ac2e71f7f8dd294276f2d98d.gz
parent 9442ad15
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,9 @@ class Doku_Renderer_metadata extends Doku_Renderer {
function document_start(){
global $ID;
$this->headers = array();
// external pages are missing create date
if(!$this->persistent['date']['created']){
$this->persistent['date']['created'] = filectime(wikiFN($ID));
......@@ -433,21 +436,12 @@ class Doku_Renderer_metadata 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;
if($create){
return sectionID($title,$this->headers);
}else{
$check = false;
return sectionID($title,$check);
}
$title = $title.$num;
$this->headers[] = $title;
}
return $title;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment