Cimbali / markdown-viewer

Markdown (.md) file viewer WebExtension for your browser.
Other
167 stars 28 forks source link

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

Open poetnerd opened 7 months ago

poetnerd commented 7 months ago

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 commented 7 months ago

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

| key | value
--------------------
| first | 0
Cimbali commented 7 months ago

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

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

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 commented 7 months ago

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