Added fix to prevent table rendering to be broken by alignment character ":".

This commit is contained in:
Alessandro Vermeulen 2015-01-09 21:32:05 +01:00
parent bd242722bb
commit 3dbc6ffcfb
3 changed files with 31 additions and 6 deletions

View File

@ -66,7 +66,7 @@
hs = line.substring(1, line.length -1).split('|');
tbl.push(tables.thead.apply(this, hs));
line = lines[++i];
if (!line.trim().match(/^[|]{1}[-=| ]+[|]{1}$/)) {
if (!line.trim().match(/^[|]{1}[-=|: ]+[|]{1}$/)) {
// not a table rolling back
line = lines[--i];
}

View File

@ -0,0 +1,21 @@
<table>
<thead>
<tr>
<th id="first_header" style="text-align:left;"> First Header </th>
<th id="second_header" style="text-align:left;"> Second Header </th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;"><p>Row 1 Cell 1 </p></td>
<td style="text-align:left;"><p>Row 1 Cell 2 </p></td>
</tr>
<tr>
<td style="text-align:left;"><p>Row 2 Cell 1 </p></td>
<td style="text-align:left;"><p>Row 2 Cell 2 </p></td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,4 @@
| First Header | Second Header |
| :------------ | :------------ |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |