4 code by Hans B Pufal <hansp@aconit.org>
6 allows html arguments inside the
7 |{border=1} wiki | table |
14 $ewiki_plugins["format_table"][] = "ewiki_format_complex_tables";
17 function ewiki_format_complex_tables(&$o, &$line, &$post, $table=0) {
21 if ((@$line[0] == '{') && ($e = strpos ($line, '}', 2)))
23 $o .= "<table " . trim (substr ($line, 1, $e - 2)) . ">\n";
24 $line = "|" . substr ($line, $e + 1);
31 $line = trim ($line, "|");
32 $telements = explode ("|", $line);
35 foreach ($telements as $td)
39 if ((strlen($td) > 1) && (@$td[0] == '{') && ($e = strpos ($td, '}', 1)))
41 $line = "<tr " . trim (substr ($td, 1, $e - 1)) . ">";
42 $td = substr ($td, $e + 1);
48 if ((strlen($td) > 1) && (@$td[0] == '{') && ($e = strpos ($td, '}', 1)))
49 $line .= "<td " . trim (substr ($td, 1, $e - 1)) . ">" . trim(substr ($td, $e + 1)) . "</td>";
51 $line .= "<td>" . trim ($td) . "</td>";