hr.footnote { width: 30%; } p.footnote { text-indent: -1em; margin-right: 3em; margin-left: 3em; margin-top: 0em; margin-bottom: 0.5em; font-size: smaller; } "; $IdPattern = "[A-Za-z][-.:_A-Za-z0-9]*"; $DoubleBrackets["/\\[\\^#($IdPattern)\\^\\]/e"] = 'shortcut($text,"$1");'; $DoubleBrackets["/\\[\\^(.*?)\\^\\]/e"] = 'footnote("$1");'; function footnote($foottext) { static $fncount, $fntext; if ($foottext == "#") { $fncount = 0; $r = "
$fntext"; $fntext = ''; } else { $fncount++; $r = "$fncount"; $foottext = stripslashes($foottext); $fntext .= "

$fncount $foottext

"; } return $r; } function shortcut($text,$anchor) { $text .= "\n"; if (preg_match("/\\[\\[#$anchor\\]\\]\\n?(.*?)\\n/",$text,$match)) { return preg_replace("/^[#*!:]+\s*/","",$match[1]); } else { return "'''$anchor''' not found."; } } ?>