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

Github tables without a header row #87

Open
vanboom opened this issue May 23, 2020 · 3 comments
Open

Github tables without a header row #87

vanboom opened this issue May 23, 2020 · 3 comments

Comments

@vanboom
Copy link

vanboom commented May 23, 2020

I have some tables that are coded in HTML without like this...

<table>
<tr>
<td><b> header 1 </b></td> <td> <b> header 2 </b> </td>
<td> item 3 </td> <td> item 4 </td>
</tr>
</table>
| header 1 | header 2 |
| item 3 | item 4 |

Suggestion: github_flavored should treat the first row as the header row to match the Github markdown spec for tables. The markdown shown above is not being converted back to HTML properly by Redcarpet or the github_markup gem (Ruby). Thanks!

@xijo
Copy link
Owner

xijo commented May 26, 2020

Hi @vanboom,

The github markdown specs looks no different to the regular one concerning tables: https://guides.github.com/features/mastering-markdown/

Maybe I don't get the point yet, but I'd rather not treat td with b tags any special unless it's a real thing in any spec.

@vanboom
Copy link
Author

vanboom commented May 30, 2020

Yes, I agree that the td + b approach would not be the best option. The issue is that I have a table that does not have a in the header so the markdown is appearling like this:

| header 1 | header 2 |
| item 3 | item 4 |

Without the | ---- | ---- | line to denote the header row, the Github markdown translator is not treating the table as a table when attempting to render the markdown back to HTML. I am using the github-markdown gem to convert the markdown to HTML.

@vanboom
Copy link
Author

vanboom commented May 30, 2020

I was able to get a possible solution working on my fork which detects and treats the first row of the table as the header row regardless of the presence of . I will try to get a PR together for your consideration.

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

2 participants