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

Add support for tables #38

Closed
sgjesse opened this issue May 5, 2015 · 1 comment · Fixed by #78
Closed

Add support for tables #38

sgjesse opened this issue May 5, 2015 · 1 comment · Fixed by #78
Labels
type-enhancement A request for a change that isn't a bug

Comments

@sgjesse
Copy link

sgjesse commented May 5, 2015

Currently support for tables is missing.

Running the following code:

import 'package:markdown/markdown.dart';

var table =
r'''
First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell
''';

main() {
  print(markdownToHtml(table));
}

prints a paragraph tag with the text.

<p>First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell</p>

It should print something like this:

<table>
<thead>
<tr><th>First Header</th><th>Second Header</th></tr>
</thead>
<tbody>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
</tbody>
</table>
@munificent
Copy link
Member

munificent commented Aug 5, 2015

It's worth noting that tables are a GitHub extension and aren't part of standard Markdown or CommonMark. Also, you can always use inline HTML for a table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants