From fcbd63695a95dfcca43eeefafbe15c607a597aa2 Mon Sep 17 00:00:00 2001 From: Michael Klier Date: Thu, 24 May 2007 21:51:46 +0200 Subject: [PATCH] ensure sidebar headlines do not break XHTML compliance darcs-hash:20070524195146-23886-64f6aa357da0f611f25b7eaf82bbf164fd99b75d.gz --- tpl_functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tpl_functions.php b/tpl_functions.php index e9e8165..f66b585 100644 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -118,5 +118,9 @@ function p_sidebar_xhtml($sb) { if(auth_quickaclcheck($sb) >= AUTH_EDIT) { $data .= '
' . html_btn('secedit',$sb,'',array('do'=>'edit','rev'=>'','post')) . '
'; } - return preg_replace('/
.*?(<\/div>\n<\/div>)/s', '', $data); + // strip TOC + $data = preg_replace('/
.*?(<\/div>\n<\/div>)/s', '', $data); + // replace headline ids for XHTML compliance + $data = preg_replace('/(.*?<\/a><\/h.*?>)/','\1sb_'.$pos.'_\2\3', $data); + return ($data); }