Merge pull request #257 from stewartmckee/fixed_undefined_text_on_codespans

Added check for undefined on text due to failing to parse tables
This commit is contained in:
Estevão Soares dos Santos 2016-05-28 15:33:12 +01:00
commit d91586b09b
3 changed files with 60 additions and 0 deletions

View File

@ -40,6 +40,10 @@ showdown.subParser('codeSpans', function (text, options, globals) {
(?!`) (?!`)
/gm, function(){...}); /gm, function(){...});
*/ */
if (typeof(text) === 'undefined') {
text = '';
}
text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
function (wholeMatch, m1, m2, m3) { function (wholeMatch, m1, m2, m3) {
var c = m3; var c = m3;

View File

@ -0,0 +1,48 @@
<h3 id="stats">Stats</h3>
<table>
<thead>
<tr>
<th>Status</th>
<th>AGENT1</th>
<th>AGENT2</th>
<th>AGENT3</th>
<th>AGENT4</th>
<th>AGENT5</th>
<th>AGENT6</th>
<th>AGENT7</th>
<th>AGENT8</th>
<th>AGENT9</th>
<th>TOTAL</th>
</tr>
</thead>
<tbody>
<tr>
<td>AGENT ERROR</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td></td>
</tr>
<tr>
<td>APPROVED</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td></td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,8 @@
### Stats
Status | AGENT1 | AGENT2 | AGENT3 | AGENT4 | AGENT5 | AGENT6 | AGENT7 | AGENT8 | AGENT9 | TOTAL |
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
AGENT ERROR | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
APPROVED | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |