mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Added fix to prevent table rendering to be broken by alignment character ":".
This commit is contained in:
parent
bd242722bb
commit
3dbc6ffcfb
|
@ -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];
|
||||
}
|
||||
|
|
21
test/extensions/table/basic-alignment.html
Normal file
21
test/extensions/table/basic-alignment.html
Normal 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>
|
4
test/extensions/table/basic-alignment.md
Normal file
4
test/extensions/table/basic-alignment.md
Normal 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 |
|
Loading…
Reference in New Issue
Block a user