simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.01k stars 131 forks source link

Recognition of Table could be more liberal. #235

Open poetnerd opened 2 months ago

poetnerd commented 2 months ago

I was having trouble rendering a table. A table like this:

| key | value

| first | 0

Was rendered raw until I specified it as this:

key value
first 0

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've just requested this enhancement to another markdown viewer I tried that has the same problem.

poetnerd commented 2 months ago

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

| key | value
--------------------
| first | 0
simov commented 2 months ago

Thanks for the feedback. The underlying compilers that this extension is using are trying to be compliant with the CommonMark spec. Most likely that syntax is not part of it, but maybe there will be a plugin to support that variation for the table definition syntax.