Skip to content

Commit

Permalink
ensure sidebar headlines do not break XHTML compliance
Browse files Browse the repository at this point in the history
darcs-hash:20070524195146-23886-64f6aa357da0f611f25b7eaf82bbf164fd99b75d.gz
  • Loading branch information
Michael Klier committed May 24, 2007
1 parent cad937d commit fcbd636
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tpl_functions.php
Expand Up @@ -118,5 +118,9 @@ function p_sidebar_xhtml($sb) {
if(auth_quickaclcheck($sb) >= AUTH_EDIT) {
$data .= '<div class="secedit">' . html_btn('secedit',$sb,'',array('do'=>'edit','rev'=>'','post')) . '</div>';
}
return preg_replace('/<div class="toc">.*?(<\/div>\n<\/div>)/s', '', $data);
// strip TOC
$data = preg_replace('/<div class="toc">.*?(<\/div>\n<\/div>)/s', '', $data);
// replace headline ids for XHTML compliance
$data = preg_replace('/(<h.*?><a.*?id=")(.*?)(">.*?<\/a><\/h.*?>)/','\1sb_'.$pos.'_\2\3', $data);
return ($data);
}

0 comments on commit fcbd636

Please sign in to comment.