summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-12-01 11:09:47 -0800
committerChristopher Smith <chris@jalakai.co.uk>2013-12-01 11:09:47 -0800
commit11faf6c73d0b3396116683c2f2e042de15a77175 (patch)
tree6a495b3425a01d23d21ab7dd5df4391596ccd31d
parenta81519ba87bacb6b06e170c86f6ae2ec0f02f2bb (diff)
parent5a41afe6e3b958291893a0a10105cd41971fb141 (diff)
downloadrpg-11faf6c73d0b3396116683c2f2e042de15a77175.tar.gz
rpg-11faf6c73d0b3396116683c2f2e042de15a77175.tar.bz2
Merge pull request #460 from splitbrain/FS#1833_b
FS#1833 (b)
-rw-r--r--_test/tests/inc/parser/parser_table.test.php19
-rw-r--r--inc/parser/parser.php4
2 files changed, 21 insertions, 2 deletions
diff --git a/_test/tests/inc/parser/parser_table.test.php b/_test/tests/inc/parser/parser_table.test.php
index 542a307b8..bc19ebff9 100644
--- a/_test/tests/inc/parser/parser_table.test.php
+++ b/_test/tests/inc/parser/parser_table.test.php
@@ -626,5 +626,24 @@ def');
);
$this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
}
+
+ function testTable_FS1833() {
+ $syntax = " \n| Row 0 Col 1 |\n";
+ $this->P->addMode('table',new Doku_Parser_Mode_Table());
+ $this->P->parse($syntax);
+ $calls = array (
+ array('document_start',array()),
+ array('table_open',array(1, 1, 2)),
+ array('tablerow_open',array()),
+ array('tablecell_open',array(1,'left',1)),
+ array('cdata',array(' Row 0 Col 1 ')),
+ array('tablecell_close',array()),
+ array('tablerow_close',array()),
+ array('table_close',array(strlen($syntax))),
+ array('document_end',array()),
+ );
+ $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
+ }
+
}
diff --git a/inc/parser/parser.php b/inc/parser/parser.php
index e39a4daf5..1f14b98a3 100644
--- a/inc/parser/parser.php
+++ b/inc/parser/parser.php
@@ -454,8 +454,8 @@ class Doku_Parser_Mode_table extends Doku_Parser_Mode {
}
function connectTo($mode) {
- $this->Lexer->addEntryPattern('\s*\n\^',$mode,'table');
- $this->Lexer->addEntryPattern('\s*\n\|',$mode,'table');
+ $this->Lexer->addEntryPattern('[\t ]*\n\^',$mode,'table');
+ $this->Lexer->addEntryPattern('[\t ]*\n\|',$mode,'table');
}
function postConnect() {