mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(subparsers/tables.js): fix parser order so that tables include all spanGamut elements
This commit is contained in:
parent
0a3a0df6bf
commit
5ec75c459b
BIN
dist/showdown.js
vendored
BIN
dist/showdown.js
vendored
Binary file not shown.
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
BIN
dist/showdown.min.js
vendored
BIN
dist/showdown.min.js
vendored
Binary file not shown.
BIN
dist/showdown.min.js.map
vendored
BIN
dist/showdown.min.js.map
vendored
Binary file not shown.
|
@ -44,7 +44,6 @@ showdown.Converter = function (converterOptions) {
|
|||
* @type {string[]}
|
||||
*/
|
||||
parserOrder = [
|
||||
'tables',
|
||||
'githubCodeBlocks',
|
||||
'hashHTMLBlocks',
|
||||
'stripLinkDefinitions',
|
||||
|
|
|
@ -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);
|
||||
|
|
26
test/features/tables/with-span-elements.html
Normal file
26
test/features/tables/with-span-elements.html
Normal file
|
@ -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
test/features/tables/with-span-elements.md
Normal file
9
test/features/tables/with-span-elements.md
Normal file
|
@ -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
|
Loading…
Reference in New Issue
Block a user