-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Simple tables vs Complex tables #171
Comments
The lack of clear specs & tests. |
I can write some tests for tables but the specs are buried on GH somewhere in code most likely... I can ask support but they may or may not share that info (possibly telling me to go hunt for it)... IDK yet. If I were to guess at this... without fully knowing this project here... I would possibly assume that a precedence issue is present on parsing and might be the issue... again IDK yet. Thanks for the reply. |
Could you simplify your example (reduce size to minimal possible)? |
@Martii Do you know what GitHub uses for GFM parser? |
@vyp @puzrin |
@Martii I looked for this before and was pointed to https://github.com/vmg/redcarpet, but then later I was told that's not what GitHub uses anymore, but I don't think I was ever told what it does use now. Hence why I asked, good luck. |
@puzrin With... | [![Mozilla SeaMonkey][imgsm]][urlsm] |
:-----:
| [![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] | ... notice that the pipes aren't matched intentionally. GH itself doesn't seem to care in my first post above... e.g. it inherits the outer pipes is a guess. This also busts it: | [![Mozilla SeaMonkey][imgsm]][urlsm] | something else |
| :-----: | :-----: | :-----: |
| [![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] ... where the "th" count is two and the next line down count is three... again GH doesn't seem to care:
No outside pipes example on all lines but still two and three column count for line one and two (SIDENOTE: broke/fixed GH's syntax highlighter with fences here since the "Greasemonkey Port" is purplish and "broke" their table rendering too ;) [![Mozilla SeaMonkey][imgsm]][urlsm] | something else
:-----: | :-----: | :-----:
[![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc]
Unbroken table on GH (line 3 has a trailing pipe now): [![Mozilla SeaMonkey][imgsm]][urlsm] | something else
:-----: | :-----: | :-----:
[![Greasemonkey Port][imggpsf]][urlgpsf] [![uso - installWith][imgiwi]][urliwi] [![GM_config][imggmc]][urlgmc] |
So it would appear that GH is centric on line two (the dashes) for creating the th tags, with probable unused column clipping, and markdown-it needs both line one and line two to be identical column count with formatting. |
Fixed, now all examples you posted above should work like they do on github. There are still no guarantees that the output will always match 'cause there is no specification for tables. |
This package doesn't seem to handle complex tables in GFM such as:
... which renders, using markdown-it, as:
... but should be rendered, using marked, as:
This is probably the only reason our project hasn't utilized this package with GFM table support appearing to be incomplete. (although I haven't tested out our HTML sanitizer with this since we need direct calls to the block rendering but that is the next step after this issue may be resolved)
Plain text tables appear to work but start doing non-text (e.g. complex md with tables) and it appears to fail. This project looks super since I first investigated it a few months back but this one little thing is enough not to use it in our project... I really like the modular (plugin) design though.
Is there a reason why complex tables aren't working? (with markdown-it) TIA
The text was updated successfully, but these errors were encountered: