Marked: GitHub Flavored Markdown Compliance

Created on 9 Apr 2018  路  6Comments  路  Source: markedjs/marked

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% |

epic

All 6 comments

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?

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

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.

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

I agree with GFM spec compliance 馃憤

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UziTech picture UziTech  路  4Comments

camwiegert picture camwiegert  路  4Comments

amejiarosario picture amejiarosario  路  3Comments

FireflyAndStars picture FireflyAndStars  路  3Comments

priyesh-diukar picture priyesh-diukar  路  3Comments