Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using tab as separator in table #370

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/kramdown/parser/kramdown/table.rb
Expand Up @@ -13,9 +13,9 @@ module Kramdown
module Parser
class Kramdown

TABLE_SEP_LINE = /^([+|: -]*?-[+|: -]*?)[ \t]*\n/
TABLE_HSEP_ALIGN = /[ ]?(:?)-+(:?)[ ]?/
TABLE_FSEP_LINE = /^[+|: =]*?=[+|: =]*?[ \t]*\n/
TABLE_SEP_LINE = /^([+|: \t-]*?-[+|: \t-]*?)[ \t]*\n/
TABLE_HSEP_ALIGN = /[ \t]?(:?)-+(:?)[ \t]?/
TABLE_FSEP_LINE = /^[+|: \t=]*?=[+|: \t=]*?[ \t]*\n/
TABLE_ROW_LINE = /^(.*?)[ \t]*\n/
TABLE_PIPE_CHECK = /(?:\||.*?[^\\\n]\|)/
TABLE_LINE = /#{TABLE_PIPE_CHECK}.*?\n/
Expand Down
21 changes: 21 additions & 0 deletions test/testcases/block/14_table/header.html
Expand Up @@ -94,3 +94,24 @@
</tr>
</tbody>
</table>

<p>Sep line with tab</p>

<table>
<thead>
<tr>
<th style="text-align: right">right</th>
<th style="text-align: center">center</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right">cell1</td>
<td style="text-align: center">cell2</td>
</tr>
<tr>
<td style="text-align: right">cell3</td>
<td style="text-align: center">cell4</td>
</tr>
</tbody>
</table>
7 changes: 7 additions & 0 deletions test/testcases/block/14_table/header.text
Expand Up @@ -30,3 +30,10 @@ Multiple bodies
| cell3 | cell4
|----|||
| cell5 | cell6

Sep line with tab

right | center
---: | :---:
cell1 | cell2
cell3 | cell4