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

Missing GFM table support #278

Closed
chengyin opened this issue Sep 17, 2019 · 4 comments
Closed

Missing GFM table support #278

chengyin opened this issue Sep 17, 2019 · 4 comments

Comments

@chengyin
Copy link

Earmark requires extra space around |, while GitHub doesn't:

#### works in earmark

State | Abbrev
----- | ------
Texas | TX


#### doesn't work in earmark

State | Abbrev
------|-------
Texas | TX

GitHub Render test:

works

State Abbrev
Texas TX

doesn't work

State Abbrev
Texas TX
@RobertDober
Copy link
Collaborator

Thank you for reporting this.

We are definitely going for maximal GFM compatibility however this seems a minor difference to me, is this an issue for you?

I will definitely keep this open but assign it low priority for now.

If this is a problem for your application, please tell me more.

Thx again

@chengyin
Copy link
Author

Hey Robert, thank you for responding! Our application allows importing markdown files, so the input is entirely out of our control. It does present a problem when the user expects to the same render result as in GitHub.

FYI, both this bug and #279 were caught through https://github.com/louthy/language-ext/blob/master/README.md.

@RobertDober
Copy link
Collaborator

RobertDober commented Sep 18, 2019

Ok if I can adapt the table behavior to the GFM behavior I will, however this was never foreseen to be done, if it breaks old behavior I am afraid you will be out of luck, but why be pessimistic.

Just to explain the rationale, while we are happy to comply with GFM as much as humanly possible, our primary goal is the continued support to ex_doc. I do understand that most people will just expect GFM nowadays, but my resources are (right now very) limited.

C.f. #249, which I would love to have, but the task is huge

@RobertDober RobertDober modified the milestones: future, 1.4.1 Sep 18, 2019
@RobertDober
Copy link
Collaborator

I have been giving this some thought.
I am afraid of backwards incompatibilities and have therefore implemented only with the new option gfm_tables

      markdown = "a|b\n-|-\nd|e\n"
      html     = "<table>...\n" 
      messages = []

      assert as_html(markdown, gfm_tables: true) == {:ok, html, messages}

I hope that will be good for you.

Hopefully GFM compatibility will advance and with issuing deprecations before adapting this behavior as default we might get to this as a default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants