\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
"Keep(TrackAnchors('$1') ? '' : \"\", 'L')");
}
else {
Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/',
"MarkupKeepTrackAnchors");
}
function MarkupKeepTrackAnchors($m) {
return Keep(TrackAnchors($m[1]) ? '' : "", 'L');
}
# in HTML5 "clear" is a style not an attribute
Markup('[[<<]]','inline','/\\[\\[<<\\]\\]/',"
");
# Allow skin header and footer to be written
# in a wiki page, and use defaults otherwise
SDVA($WrapSkinSections, array(
'#skinheader' => '',
'#skinfooter' => '',
));
SDVA($HideTemplateSections, array(
'#skinheader' => 'PageHeaderFmt',
'#skinfooter' => 'PageFooterFmt',
));
# This function prints a skin element which is written
# inside a [[#header]]...[[#headerend]] section in Site.SkinElements
# overriding the existing section from the template file
function SkinFmt($pagename, $args) {
global $WrapSkinSections, $HideTemplateSections, $TmplDisplay;
$args = preg_split('!\\s+!', $args, -1, PREG_SPLIT_NO_EMPTY);
$section = array_shift($args);
$hidesection = $HideTemplateSections[$section];
if(isset($TmplDisplay[$hidesection]) && $TmplDisplay[$hidesection] == 0) {
return; # Section was disabled by (:noheader:) or (:nofooter:)
}
static $pagecache = array();
foreach($args as $p) {
$pn = FmtPageName($p, $pagename);
if(! isset($pagecache[$pn])) {
$page = RAPC($pn);
$pagecache[$pn] = strval(@$page['text']);
}
if($pagecache[$pn] == "") continue;
$rx = "/\\[\\[$section\\]\\](?: *\n+)?(.*?)\\s*\\[\\[{$section}end\\]\\]/s";
if(preg_match($rx, $pagecache[$pn], $m)) {
$elm = $m[1];
}
else continue;
if(!$elm) continue;
$html = MarkupToHTML($pagename, Qualify($pn, $elm));
echo sprintf($WrapSkinSections[$section], $html);
SetTmplDisplay($hidesection,0);
return;
}
if(@$DefaultSkinElements[$section])
echo FmtPageName($DefaultSkinElements[$section], $pagename);
}