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 Flavored Markdown Compliance #1211

Closed
joshbruce opened this issue Apr 9, 2018 · 6 comments
Closed

GitHub Flavored Markdown Compliance #1211

joshbruce opened this issue Apr 9, 2018 · 6 comments
Labels
epic A large goal or objective for a major release.
Milestone

Comments

@joshbruce
Copy link
Member

Marked version: 0.3.19

Markdown flavor: GitHub Flavored Markdown (GFM)

Proposal type: other

What pain point are you perceiving?

See #1202 only focused on the GFM.

What solution are you suggesting?

PR #1210 looks to run Marked against the GFM extension test cases: no file generated

So far the results show that we are roughly 56% spec-compliant.

The spec is divided into sections and each section has a number of test cases. (Counts may be off and are meant to represent estimate percent compliance with each section.)

Section Count Percent
Tables 3 of 8 38%
Task list items 0 of 2 0%
Strikethrough 1 of 3 33%
Autolinks 10 of 11 91%
Disallowed Raw HTML 0 of 1 0%
@joshbruce joshbruce added the epic A large goal or objective for a major release. label Apr 9, 2018
@joshbruce joshbruce added this to the v0.x milestone Apr 9, 2018
@tomtheisen
Copy link

I've been working on GFM tables compliance. It seems that it's currently impossible because of PR#221. Marked has decided to violate the GFM spec in the hope that GFM would catch up. AFAICT this is not going to happen.

The particular point at issue is how table cells are aligned. Using attributes or inline styles?

Attribute (per GFM)

<td align="right">foo</td>

Inline Style (Marked behavior)

<td style="text-align: right;">foo</td>

I can see only a few ways forward.

  1. The GFM spec changes to use styles.
  2. Marked abandons the decision made in PR221.
  3. Marked abandons the goal of achieving total GFM compliance.

Did I miss anything? Who can make this decision?

@UziTech
Copy link
Member

UziTech commented Apr 30, 2018

My vote is for spec compliance #2

Anyone who needs the alignment in css can do:

let html = marked(md, {gfm: true});
html = html.replace(/<(td|th) align="/g, '<$1 style="text-align:');

/cc @joshbruce @styfle @davisjam

@joshbruce
Copy link
Member Author

Agree with @UziTech. Think the style use was an override of spec-compliance.

So, abandon decision made in #221...didn't even know that was a decision that was made.

@tomtheisen: To your other question, as a publisher I tend to set the priority (with ample feedback from everyone esle). We've decided, for now, to prioritize security then spec-compliance; so, chances are if there's a debate that can be argued from the spec, the spec will win.

@joshbruce
Copy link
Member Author

ps. Thanks to @tomtheisen, thanks for the continued contributions.

@styfle
Copy link
Member

styfle commented Apr 30, 2018

I agree with GFM spec compliance 👍

As long as we release this as a breaking change so we make users aware 🥂

@tomtheisen
Copy link

I created a PR for GFM table compliance. I don't really know what I'm doing in marked, so feedback is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic A large goal or objective for a major release.
Projects
None yet
Development

No branches or pull requests

4 participants