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

Table rendering is not liberal enough in accepting valid tables. #114

Open
poetnerd opened this issue Apr 21, 2024 · 3 comments
Open

Table rendering is not liberal enough in accepting valid tables. #114

poetnerd opened this issue Apr 21, 2024 · 3 comments

Comments

@poetnerd
Copy link

A user opened issue #83 because they thought tables were not supported. The issue was closed, instructing the user to put a final vertical bar to create a proper table.

Protocols 101: "Be liberal in what you accept. Be conservative in what you produce."

Many markdown rendering engines are more liberal in what they accept as a valid table. For example the renderer used by the fossil source code manager https://fossil-scm.org/home/doc/trunk/www/index.wiki (which is the system developed by and used by the SQLite DB community.)

This markdown-viewer would be easier to use, less confusing to those who are getting away with less conservatively formatted tables in markdown if the following two enhancements were made:

  1. Do not require a closing vertical bar.
  2. Do not require the horizontal line at the top to contain vertical bars.

I.E. This table should be valid:

| key | value

| first | 0

@poetnerd
Copy link
Author

Let me try again to provide the currently invalid table (this time as code in Markdown.):

| key | value
--------------------
| first | 0

@Cimbali
Copy link
Owner

Cimbali commented Apr 22, 2024

I don’t necessarily disagree, but there are a couple of difficulties:

  • markdown-viewer doesn’t do rendering, it uses markdown-it as a renderer, so your issue would be a better fit there.
  • a line of dashes (as you can see by the github rendering) means an h2 title.
  • in general there are ambiguities in the markdown spec, but that doesn’t mean it’s a free-for-all and we should change what text means after the fact. This can only lead to confusion.

If you look at Babelmark, the markdown implementations comparator, we have:

  • 22 interpret your code as h2 followed by text
  • 2 interpret as a 1-column table (just with the first column: key, first). Note that both use maruku which is marked obsolete.
  • 1 interprets as text separated by a horizontal rule
  • 1 interprets as just a horizontal rule
  • 10 failed

So even throwing fossil in the mix that’s still a very small minority. As there isn’t a governing body for markdown spec, so I don’t think there’s even anyone you could petition for this change.

@Cimbali
Copy link
Owner

Cimbali commented Apr 22, 2024

I’d be surprised your fossil renderer doesn’t support the more common syntax with closing vertical bars though.

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

2 participants