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 are broken on v0.6 #1429

Closed
amejiarosario opened this issue Feb 27, 2019 · 3 comments
Closed

Tables are broken on v0.6 #1429

amejiarosario opened this issue Feb 27, 2019 · 3 comments

Comments

@amejiarosario
Copy link

Describe the bug
Tables are broken!

To Reproduce
Go to https://marked.js.org and use the following table with versions 0.3 and 0.4+

Marked v0.3
image

Marked v0.4+
image

Markdown example

Name | Insert | Access | Search | Delete | Comments
-|-|-|-|-
[**Array**](#Array) | [*O(n)*](#Insert-element-on-an-array) | [*O(1)*](#Access-an-element-in-an-array) | [*O(n)*](#Search-an-element-in-an-array) | [*O(n)*](#Deleting-elements-from-an-array) | Insertion to the end is `O(1)`. [Details here.](#Array-operations-time-complexity)
[(Hash)**Map**](#HashMaps) | [*O(1)**](#Insert-element-on-a-HashMap-runtime) | [*O(1)**](#Search-Access-an-element-on-a-HashMap-runtime) | [*O(1)**]

Expected behavior
The table should render as in versions 0.3

@UziTech
Copy link
Member

UziTech commented Feb 27, 2019

Looks like you are missing a column for the line of dashes

- -|-|-|-|-
+ -|-|-|-|-|-

If you copy your markdown example into github it won't render as a table

@styfle
Copy link
Member

styfle commented Feb 27, 2019

Also compare marked with the commonmark output.

Neither produce a table.
This is probably due to better conformance to the commonmark spec.

@amejiarosario
Copy link
Author

So it looks like version 0.3 was more forgiving. As @UziTech pointed out I was missing the |-. Now, it works with any version of marked and github:

Name Insert Access Search Delete Comments
Array O(n) O(1) O(n) O(n) Insertion to the end is O(1). Details here.
(Hash)Map *O(1)** *O(1)** O(1)

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

3 participants