chobie / php-sundown

php-sundown is just simple wrapper of sundown
Other
137 stars 16 forks source link

tables problem #38

Closed rhyzx closed 10 years ago

rhyzx commented 10 years ago

https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables

codes:

$src = '
| Tables        | Are           |
| ------------- |:-------------:|
| zebra stripes | are neat      |
';

$md = new \Sundown\Markdown(\Sundown\Render\HTML, array(
    'tables' => true,
    'autolink' => true,
    'strikethrough' => true,
    'lax_html_blocks' => true,
    'no_intra_emphasis' => true,
    'fenced_code_blocks' => true,
    'space_after_headers' => true,
    // 'superscript' => true,
));
$md->getRender()->setRenderFlags(array(
    'hard_wrap' => true,
    // 'filter_html' => true,
));

echo $md->render($src);

outputs:

PHP Warning:  Sundown\Render\HTML::tableCell() expects parameter 2 to be long, string given in /Users/rhyzx/Projects/ALI/ATA2/t.php on line 29
<table><thead>
<tr>
<td>Tables</td>
<td>Are</td>
</tr>
</thead><tbody>
<tr>
<td>zebra stripes</td>
</tr>
</tbody></table>
chobie commented 10 years ago

Thanks reporting issue. I've fixed this and will release 3.12 in a few days. please check sundown-3.x if you wanna try this.

asgh commented 10 years ago

These changes have not actually been merged into main. They are only on a branch that doesn't seem used for anything else.

So this bug still exists for anyone using this without specifically picking the branch.