currentItem =& $data["item"]; $this->currentItem->body = removeBreaks($this->currentItem->body); // $this->currentItem->body = str_replace("\r\n", "\n", $this->currentItem->body); $this->currentItem->body = preg_replace_callback("#\|(.*)\|\r\n#", array(&$this, 'list_table'), $this->currentItem->body); $this->currentItem->body = preg_replace_callback("#\!(.*)\!#", array(&$this, 'convert_table'), $this->currentItem->body); $this->currentItem->body = addBreaks($this->currentItem->body); $this->currentItem->more = preg_replace_callback("#\|(.*?)\|#", array(&$this, 'convert_table'), $this->currentItem->more); } function list_table($text) { return "!" . $text[1] . "!"; } function convert_table($text) { $rows = explode('!!', $text[1]); for ($r =0; $r < count($rows); $r++) { $cell = explode('|', $rows["$r"]); for ($c = 0; $c < count($cell); $c++) { $cols["$c"]["$r"] = $cell["$c"]; } } for ($c = 0; $c < count($cols); $c++) { $cols["$c"] = array_reverse ($cols["$c"], TRUE); $rowspan = 1; // print_r($cols["$c"]); foreach($cols["$c"] as $key => $val) { if ($val == '~') { $rowspan ++; $row["$key"]["$c"] = $val; } elseif($val == '>') { $row["$key"]["$c"] = $val; } elseif($rowspan > 1) { $row["$key"]["$c"] = '