From f05a1cc5fcdb4c2b6ee3cbf499f980f800dbd105 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 17 Oct 2013 23:11:33 +0200 Subject: Wrap thead around 1st row, when 1st cell at 1st row is tableheader. Implements FS#1764 --- _test/tests/inc/parser/parser_table.test.php | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to '_test/tests/inc/parser') diff --git a/_test/tests/inc/parser/parser_table.test.php b/_test/tests/inc/parser/parser_table.test.php index 542a307b8..5258afe3d 100644 --- a/_test/tests/inc/parser/parser_table.test.php +++ b/_test/tests/inc/parser/parser_table.test.php @@ -125,6 +125,7 @@ def'); array('cdata',array("\n\nabc")), array('p_close',array()), array('table_open',array(3, 1, 6)), + array('tablethead_open',array()), array('tablerow_open',array()), array('tableheader_open',array(1,NULL,1)), array('cdata',array(' X ')), @@ -136,6 +137,7 @@ def'); array('cdata',array(' Z ')), array('tableheader_close',array()), array('tablerow_close',array()), + array('tablethead_close',array()), array('table_close',array(19)), array('p_open',array()), array('cdata',array('def')), @@ -146,6 +148,55 @@ def'); $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } + + function testTableHeadersMultilines() { + $this->P->addMode('table',new Doku_Parser_Mode_Table()); + $this->P->parse(' +abc +^ X | Y ^ Z | +| A | B | 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(3, 2, 6)), + array('tablethead_open',array()), + array('tablerow_open',array()), + array('tableheader_open',array(1,NULL,1)), + array('cdata',array(' X ')), + array('tableheader_close',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' Y ')), + array('tablecell_close',array()), + array('tableheader_open',array(1,NULL,1)), + array('cdata',array(' Z ')), + array('tableheader_close',array()), + array('tablerow_close',array()), + array('tablethead_close',array()), + array('tablerow_open',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' A ')), + array('tablecell_close',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' B ')), + array('tablecell_close',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' C ')), + array('tablecell_close',array()), + array('tablerow_close',array()), + array('table_close',array(33)), + 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 testCellAlignment() { $this->P->addMode('table',new Doku_Parser_Mode_Table()); -- cgit v1.2.3