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

Tables should not require three dashes per cell in delimiter row #231

Open
jchv opened this issue Oct 8, 2018 · 0 comments
Open

Tables should not require three dashes per cell in delimiter row #231

jchv opened this issue Oct 8, 2018 · 0 comments

Comments

@jchv
Copy link

jchv commented Oct 8, 2018

It looks like GitHub now supports tables with less than three dashes in the delimiter row. Reading in the GitHub Flavored Markdown spec, I don't see anything claiming you need three dashes to make a table, either. Finally, the github/cmark library definitely supports tables with single dash delimiters, a la:

| a | b |
| - | - |
| 1 | 2 |
a b
1 2

Is it possible this should be revisited now? It's awkward that many other Markdown libraries (including Marked.js and github/cmark) support the syntax with only one dash but Hoedown does not.

Redcarpet also now renders tables with single dashes.

$ apt install ruby ruby-dev
$ gem install --user redcarpet
$ ruby -e "require 'redcarpet'" \
  -e 'markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options = {}), extensions = {tables: true})' \
  -e 'puts markdown.render("| a | b |\n| - | - |\n| 1 | 2 |")'
<table><thead>
<tr>
<th>a</th>
<th>b</th>
</tr>
</thead><tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
</tbody></table>

Interestingly, Showdown appears to support tables with two dashes, but not one.

In any case, it appears that this behavior of Hoedown's does not match the popular behavior of GitHub Flavored Markdown as seen on GitHub, GitLab, Jekyll, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant