mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix: spaces on a newline after a table (#2319)
* fix: rename inconsistent function * fix: newline with 1~4 spaces below table * fix: format html test * fix: specify spaces only * fix: specify spaces only * fix: detect tab * fix: detect tab * fix: newline at the end of html
This commit is contained in:
+1
-1
@@ -355,7 +355,7 @@ export class Tokenizer {
|
||||
type: 'table',
|
||||
header: splitCells(cap[1]).map(c => { return { text: c }; }),
|
||||
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
||||
rows: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
|
||||
rows: cap[3] ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
|
||||
};
|
||||
|
||||
if (item.header.length === item.align.length) {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>y</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>y</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>y</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>x</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre><code>code
|
||||
</code></pre>
|
||||
@@ -0,0 +1,12 @@
|
||||
| y |
|
||||
| - |
|
||||
| x |
|
||||
|
||||
| y |
|
||||
| - |
|
||||
| x |
|
||||
|
||||
| y |
|
||||
| - |
|
||||
| x |
|
||||
code
|
||||
Reference in New Issue
Block a user