4 Emulates UseMode like headlines (but others use this too).
5 == Heading == corresponds to !!! Large Heading
6 === Heading === corresponds to !! Meadium
7 ==== Heading ==== corresponds to ! Smallest Headline
8 === # anchored headline ===
10 And then also allows for:
15 $ewiki_plugins["format_source"][] = "ewiki_format_src_usemod_headings";
18 function ewiki_format_src_usemod_headings(&$src) {
23 $src = preg_replace('/^(={2,4})([^=].*?)==+\s*$/me',
25 str_repeat("!", $we = (5 - strlen("\\1")) ) . " "
26 . (($uu=stripslashes(trim("\\2"))) && ($uu[0]=="#")
27 ? ($GLOBALS["usemod_toc"][][$we]=$uu=trim(substr($uu, 1)))
28 . (" #[" . preg_replace("/[^\w]/", "_", $uu) . "]")
35 if (strpos($src, "<toc>")) {
36 foreach ($usemod_toc as $i=>$d) {
37 foreach ($d as $num=>$str) {
38 $toc_str .= str_repeat("*", 4 - $num) . " [.#$str \"$str\"] \n";
41 $src = preg_replace("'<toc>'", $toc_str, $src);