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 from MediaWiki to GitHub Flavored Markdown (GFM) #1996
Comments
Summary of the issue: pipe tables without headers are not rendered |
+++ Nikolay Yakimov [Mar 25 15 05:09 ]:
Argh! The fragmentation is killing me.
I'm open to this. |
|
It would be nice to have |
Note that Pandoc is a little picky about the blank header. It's okay with the first but not the second.
|
Let's test GitHub issues:
Pandoc is okay with this one, GitHub issues is not.
Neither Pandoc nor GitHub issues likes this one. |
Weird. The second column has been dropped. So strange. |
Let's try another.
GitHub is okay with this one, but Pandoc is not. |
The moral of the story appears to be: do not leave out either the leading or trailing column of pipes. |
When you try to actually specify the syntax for pipe tables, allowing that the initial and final bar are optional, it's surprisingly tricky. (And, unsurprisingly, no two implementations seem to agree.) |
@sjackman , sorry to bump the topic, I'm converting a stash of tables and don't have an opportunity to modify all headers by hand. |
Minimal table examples based on official MediaWiki documentation at http://www.mediawiki.org/wiki/Help:Tables
Conversions with pandoc 1.13.2 (on Mac OS), here's the default markdown output (which I am not using):
Here's the GFM which I do want to use (and tables are one of the key differences Google introduced):
MediaWiki format table renders fine on GitHub:
https://github.com/peterjc/peterjc.github.io/blob/table_problem/table.mediawiki
The pandoc GFM Markdown output does not render properly on GitHub:
https://github.com/peterjc/peterjc.github.io/blob/table_problem/table.md
The GFM documentation on tables is limited https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables but all the examples I have seen appear to use (require?) a header row.
We can 'fix' the table by moving the dash line down one, making the first row into a header, e.g.
This 'works' but is visually not quite what the user may expect:
In practice, most real tables do have a header row so this is usable.
Another hack may be to include a blank header row, e.g.
which gives:
Here are those two work arounds as rendered directly on GitHub (rather than here on a GitHub issue which can sometimes be slightly different):
https://github.com/peterjc/peterjc.github.io/blob/table_problem/table_header.md
The text was updated successfully, but these errors were encountered: