Skip to content

Commit

Permalink
fix(subparsers/tables.js): fix parser order so that tables include al…
Browse files Browse the repository at this point in the history
…l spanGamut elements
  • Loading branch information
tivie committed Jul 11, 2015
1 parent 0a3a0df commit 5ec75c4
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ showdown.Converter = function (converterOptions) {
* @type {string[]}
*/
parserOrder = [
'tables',
'githubCodeBlocks',
'hashHTMLBlocks',
'stripLinkDefinitions',
Expand Down
1 change: 1 addition & 0 deletions src/subParsers/blockGamut.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ showdown.subParser('blockGamut', function (text, options, globals) {
text = text.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm, key);
text = text.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, key);

text = showdown.subParser('tables')(text, options, globals);
text = showdown.subParser('lists')(text, options, globals);
text = showdown.subParser('codeBlocks')(text, options, globals);
text = showdown.subParser('blockQuotes')(text, options, globals);
Expand Down
26 changes: 26 additions & 0 deletions test/features/tables/with-span-elements.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>bold</strong></td>
<td><img src="foo.jpg" alt="img" /></td>
</tr>
<tr>
<td><em>italic</em></td>
<td><a href="bla.html">link</a></td>
</tr>
<tr>
<td><code>some code</code></td>
<td><a href="www.google.com">google</a></td>
</tr>
<tr>
<td><a href="www.foo.com">www.foo.com</a></td>
<td>normal</td>
</tr>
</tbody>
</table>
9 changes: 9 additions & 0 deletions test/features/tables/with-span-elements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
| First Header | Second Header |
| ------------- | ----------------- |
| **bold** | ![img](foo.jpg) |
| _italic_ | [link](bla.html) |
| `some code` | [google][1] |
| <www.foo.com> | normal |


[1]: www.google.com

0 comments on commit 5ec75c4

Please sign in to comment.