"); Markup("checkedbox", "inline", "/\[x\]/", ""); Markup("citationneeded", "inline", "/\{\{(cn|[Cc]itation needed)(\|(reason|date)=.+?)?\}\}/", "[citation needed]"); function Footnote($m) { static $fngroup = 1, $fncount = 0, $fntext = array(); $fn_str = $m[1]; if ($fn_str == "#" || $fn_str == "@") { if ($fncount > 0) { ksort($fntext); $out = ($fn_str == "#") ? "<:block>
 
\n" . implode('',$fntext) : implode('',$fntext); } $fntext = array(); $fncount = 0; $fngroup++; } else { $fncount++; if (preg_match("/#([0-9]+)(?>\\s+(.+))?/s", $fn_str, $fn_str_parts)) { $fncount = $fn_str_parts[1]; $fn_str = $fn_str_parts[2]; } $fnid = $fngroup . '_' . $fncount; $out = (isset($fn_str_parts[2]) && $fn_str_parts[2] != '' && $fntext[$fncount] == '#') ? '' : "[$fncount]"; global $FootnoteBacklinkCharacter; if ($fn_str != '') { $fntext[$fncount] = "
\n" . "$fncount {$fn_str} $FootnoteBacklinkCharacter\n" . "
"; } else if ($fntext[$fncount] == '') { $fntext[$fncount] = '#'; } } return $out; }