Browse Source

Don't add tabs to tables markup

pull/14/head
Vitaly Puzrin 10 years ago
parent
commit
5412189997
  1. 10
      lib/renderer.js
  2. 80
      test/fixtures/remarkable/tables.txt

10
lib/renderer.js

@ -141,19 +141,19 @@ rules.table_close = function (/*tokens, idx, options*/) {
return '</table>\n';
};
rules.thead_open = function (/*tokens, idx, options*/) {
return '\t<thead>\n';
return '<thead>\n';
};
rules.thead_close = function (/*tokens, idx, options*/) {
return '\t</thead>\n';
return '</thead>\n';
};
rules.tbody_open = function (/*tokens, idx, options*/) {
return '\t<tbody>\n';
return '<tbody>\n';
};
rules.tbody_close = function (/*tokens, idx, options*/) {
return '\t</tbody>\n';
return '</tbody>\n';
};
rules.tr_open = function (/*tokens, idx, options*/) {
return '\t\t<tr>';
return '<tr>';
};
rules.tr_close = function (/*tokens, idx, options*/) {
return '</tr>\n';

80
test/fixtures/remarkable/tables.txt

@ -7,13 +7,13 @@ Tests from marked:
| Cell 3 | Cell 4
.
<table>
<thead>
<tr><th>Heading 1</th><th>Heading 2</th></tr>
</thead>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
<thead>
<tr><th>Heading 1</th><th>Heading 2</th></tr>
</thead>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
</table>
.
@ -24,13 +24,13 @@ Tests from marked:
| Cell 5 | Cell 6 | Cell 7 | Cell 8 |
.
<table>
<thead>
<tr><th style="text-align:center">Header 1</th><th style="text-align:right">Header 2</th><th style="text-align:left">Header 3</th><th>Header 4</th></tr>
</thead>
<tbody>
<tr><td style="text-align:center">Cell 1</td><td style="text-align:right">Cell 2</td><td style="text-align:left">Cell 3</td><td>Cell 4</td></tr>
<tr><td style="text-align:center">Cell 5</td><td style="text-align:right">Cell 6</td><td style="text-align:left">Cell 7</td><td>Cell 8</td></tr>
</tbody>
<thead>
<tr><th style="text-align:center">Header 1</th><th style="text-align:right">Header 2</th><th style="text-align:left">Header 3</th><th>Header 4</th></tr>
</thead>
<tbody>
<tr><td style="text-align:center">Cell 1</td><td style="text-align:right">Cell 2</td><td style="text-align:left">Cell 3</td><td>Cell 4</td></tr>
<tr><td style="text-align:center">Cell 5</td><td style="text-align:right">Cell 6</td><td style="text-align:left">Cell 7</td><td>Cell 8</td></tr>
</tbody>
</table>
.
@ -41,13 +41,13 @@ Cell 1 | Cell 2
Cell 3 | Cell 4
.
<table>
<thead>
<tr><th>Header 1</th><th>Header 2</th></tr>
</thead>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
<thead>
<tr><th>Header 1</th><th>Header 2</th></tr>
</thead>
<tbody>
<tr><td>Cell 1</td><td>Cell 2</td></tr>
<tr><td>Cell 3</td><td>Cell 4</td></tr>
</tbody>
</table>
.
@ -58,13 +58,13 @@ Cell 1 |Cell 2 |Cell 3 |Cell 4
*Cell 5*|Cell 6 |Cell 7 |Cell 8
.
<table>
<thead>
<tr><th style="text-align:left">Header 1</th><th style="text-align:center">Header 2</th><th style="text-align:right">Header 3</th><th>Header 4</th></tr>
</thead>
<tbody>
<tr><td style="text-align:left">Cell 1</td><td style="text-align:center">Cell 2</td><td style="text-align:right">Cell 3</td><td>Cell 4</td></tr>
<tr><td style="text-align:left"><em>Cell 5</em></td><td style="text-align:center">Cell 6</td><td style="text-align:right">Cell 7</td><td>Cell 8</td></tr>
</tbody>
<thead>
<tr><th style="text-align:left">Header 1</th><th style="text-align:center">Header 2</th><th style="text-align:right">Header 3</th><th>Header 4</th></tr>
</thead>
<tbody>
<tr><td style="text-align:left">Cell 1</td><td style="text-align:center">Cell 2</td><td style="text-align:right">Cell 3</td><td>Cell 4</td></tr>
<tr><td style="text-align:left"><em>Cell 5</em></td><td style="text-align:center">Cell 6</td><td style="text-align:right">Cell 7</td><td>Cell 8</td></tr>
</tbody>
</table>
.
@ -78,12 +78,12 @@ baz|baz
.
<blockquote>
<table>
<thead>
<tr><th>foo</th><th>foo</th></tr>
</thead>
<tbody>
<tr><td>bar</td><td>bar</td></tr>
</tbody>
<thead>
<tr><th>foo</th><th>foo</th></tr>
</thead>
<tbody>
<tr><td>bar</td><td>bar</td></tr>
</tbody>
</table>
</blockquote>
<p>baz|baz</p>
@ -99,12 +99,12 @@ Nested tables inside lists:
.
<ul>
<li><table>
<thead>
<tr><th>foo</th><th>foo</th></tr>
</thead>
<tbody>
<tr><td>bar</td><td>bar</td></tr>
</tbody>
<thead>
<tr><th>foo</th><th>foo</th></tr>
</thead>
<tbody>
<tr><td>bar</td><td>bar</td></tr>
</tbody>
</table>
</li>
</ul>

Loading…
Cancel
Save