summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_test/tests/inc/parser/parser_table.test.php58
-rw-r--r--inc/parser/handler.php3
2 files changed, 60 insertions, 1 deletions
diff --git a/_test/tests/inc/parser/parser_table.test.php b/_test/tests/inc/parser/parser_table.test.php
index 96789c38c..542a307b8 100644
--- a/_test/tests/inc/parser/parser_table.test.php
+++ b/_test/tests/inc/parser/parser_table.test.php
@@ -270,6 +270,64 @@ def');
);
$this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
}
+
+ function testCellRowSpanFirstRow() {
+ $this->P->addMode('table',new Doku_Parser_Mode_Table());
+ $this->P->parse('
+abc
+|::: ^ d:::^:::| ::: |
+| b ^ e | | ::: |
+|c ^ ::: | |:::|
+def');
+
+ $calls = array (
+ array('document_start',array()),
+ array('p_open',array()),
+ array('cdata',array("\n\nabc")),
+ array('p_close',array()),
+ array('table_open',array(4, 3, 6)),
+ array('tablerow_open',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array('')),
+ array('tablecell_close',array()),
+ array('tableheader_open',array(1,'right',1)),
+ array('cdata',array(' d:::')),
+ array('tableheader_close',array()),
+ array('tableheader_open',array(1,NULL,1)),
+ array('cdata',array('')),
+ array('tableheader_close',array()),
+ array('tablecell_open',array(1,NULL,3)),
+ array('cdata',array('')),
+ array('tablecell_close',array()),
+ array('tablerow_close',array()),
+ array('tablerow_open',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array(' b ')),
+ array('tablecell_close',array()),
+ array('tableheader_open',array(1,'left',2)),
+ array('cdata',array(' e ')),
+ array('tableheader_close',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array(' ')),
+ array('tablecell_close',array()),
+ array('tablerow_close',array()),
+ array('tablerow_open',array()),
+ array('tablecell_open',array(1,'left',1)),
+ array('cdata',array('c ')),
+ array('tablecell_close',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array(' ')),
+ array('tablecell_close',array()),
+ array('tablerow_close',array()),
+
+ array('table_close',array(69)),
+ array('p_open',array()),
+ array('cdata',array('def')),
+ array('p_close',array()),
+ array('document_end',array()),
+ );
+ $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+ }
function testCellAlignmentFormatting() {
$this->P->addMode('table',new Doku_Parser_Mode_Table());
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index b72f051ae..1de981b48 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -1371,7 +1371,8 @@ class Doku_Handler_Table {
if (is_null($spanning_cell)) {
// No spanning cell found, so convert this cell to
// an empty one to avoid broken tables
- $this->tableCells[$key][1][1] = '';
+ $this->tableCalls[$key][0] = 'cdata';
+ $this->tableCalls[$key][1][0] = '';
continue;
}
$this->tableCalls[$cellKey[$spanning_cell][$lastCell]][1][2]++;