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

Markdown tables with 2 character dashes under headers do not render as tables #371

Closed
kendaleiv opened this issue Sep 18, 2014 · 18 comments
Closed

Comments

@kendaleiv
Copy link

Id Name
1 Test

does not render as a table, whereas

Id Name
1 Test

does.

Is this expected behavior?

@pchaigno
Copy link
Contributor

Why would you want to use only 2?

@kendaleiv
Copy link
Author

Using the same number of characters as the header to create the divider, in this case, Id.

@pchaigno
Copy link
Contributor

As long as you put as least 3 dashes, the table will always look the same.

| Id | Name |
| ----------------- | ---- |
| 1 | Test |

render as

Id Name
1 Test

@kendaleiv
Copy link
Author

Yes, but I am raising the issue that GitHub users could construct tables in terms of my first example, and that is not displayed as an HTML table.

@pchaigno
Copy link
Contributor

Oh. I see.
Redcarpet renders the Markdown. You should maybe post an issue on their repository.

@kendaleiv
Copy link
Author

OK, thanks! Created vmg/redcarpet#418.

@gjtorikian
Copy link
Contributor

Redcarpet does not render our Markdown. We use an internal closed-source gem, github-markdown.

However, the three dashes are expected behavior.

@kendaleiv
Copy link
Author

Are the three dashes required, and two is simply invalid?

@pchaigno
Copy link
Contributor

Oh my bad. The README.md is a bit confusing:

The following markups are supported. The dependencies listed are required if you wish to run the library. You can also run script/bootstrap to fetch them all.
.markdown, .mdown, .mkdn, .md -- gem install redcarpet (https://github.com/vmg/redcarpet)

I assumed RedCarpet was rendering the Markdown without really checking the code :/

@kendaleiv
Copy link
Author

Reopening in light of new information from @gjtorikian.

@kendaleiv kendaleiv reopened this Sep 18, 2014
@mojavelinux
Copy link
Contributor

Redcarpet does not render our Markdown. We use an internal closed-source gem, github-markdown.

That's the interface gem, but underneath it still uses an actual Markdown implementation. It's not clear from the code which implementation that is, but my understanding is that it's Redcarpet.

https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb

@gjtorikian
Copy link
Contributor

And we walk through all the Markdown implementations available to stop at the one that loads first: https://github.com/github/markup/blob/master/lib/github/markup/markdown.rb#L33-L39

Are the three dashes required, and two is simply invalid?

Three (or more) dashes, yes.

@kendaleiv
Copy link
Author

This is a minor issue -- but supporting the two character use case (and, maybe a single char as well) would be a nice touch for GitHub users. I ran into this during my workday today.

@bkeepers
Copy link
Contributor

Thanks for the request. I've logged it with our internal teams.

@kendaleiv
Copy link
Author

Thanks! 🍰

@greenlaw110
Copy link

greenlaw110 commented Oct 25, 2016

not sure why the following table doesn't work:

The source code:

 | URL    | Accept | Effective URL |
 | ------ | ------ | ------------- |
 | `/csv` | `text/csv` |  `/`  |
 | `/json` | `application/json` | `/` |
 | `/xls` | `application/vnd.ms-excel` | `/` |
 | `/xlsx` | `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` | `/` |

It doesn't render as a table:

URL Accept Effective URL
/csv text/csv /
/json application/json /
/xls application/vnd.ms-excel /
/xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet /

@pchaigno
Copy link
Contributor

@greenlaw110 You need to remove the single space before each line.

@greenlaw110
Copy link

@pchaigno yes I just noticed that :-)

FirstTimeInForever added a commit to FirstTimeInForever/intellij-markdown that referenced this issue Jul 21, 2022
…iter row

Some time after [#371](github/markup#371) GFM relaxed constraints on the minimal number of required dashes in table delimiter row.
FirstTimeInForever added a commit to JetBrains/markdown that referenced this issue Dec 13, 2022
Some time after [#371](github/markup#371) GFM relaxed constraints on the minimal number of required dashes in table delimiter row.
pbodnar added a commit to miyuchina/mistletoe that referenced this issue Dec 9, 2023
In or around [#371](github/markup#371), GFM relaxed constraints on the minimal number of required dashes in table delimiter row.

So we relax the constraints as well. To "compensate" for this change,
we check the format of the delimiter row more thoroughly (although
we still do *not* check number of cells in the delimiter row).
pbodnar added a commit to miyuchina/mistletoe that referenced this issue Dec 9, 2023
In or around [#371](github/markup#371), GFM relaxed constraints on the minimal number of required dashes in table delimiter row.

So we relax the constraints as well. To "compensate" for this change,
we check the format of the delimiter row more thoroughly (although
we still do *not* check number of cells in the delimiter row).
pbodnar added a commit to miyuchina/mistletoe that referenced this issue Dec 14, 2023
In or around [#371](github/markup#371), GFM relaxed constraints on the minimal number of required dashes in table delimiter row.

So we relax the constraints as well. To "compensate" for this change,
we check the format of the delimiter row more thoroughly (although
we still do *not* check number of cells in the delimiter row).
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

6 participants