shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.41k stars 170 forks source link

Table: support grid tables #1571

Open amra opened 6 years ago

amra commented 6 years ago

markdown-preview-enhanced doesn't support all table syntax: https://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#tables

One of them is grid table syntax. This is used as default syntax for docx-markdown conversion in pandoc tool :-(

Syntax example

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+
kachkaev commented 6 years ago

@amra feel free to submit a PR to https://github.com/shd101wyy/mume/ with this feature (it's the core of MPE).

amra commented 6 years ago

Could you please give me few hints where to start?

kachkaev commented 6 years ago

I'd start from searching for a markdown-it plugin that can already parse your table syntax. If that's not out there, it will be necessary to implement it, which may be pretty challenging.

Once the markdown-it plugin has been found or developed, you can add it to mume's src/custom-markdown-it-features and src/markdown-engine.ts just like this has been done for other extended features 🙂

The final bits will be submitting a PR and documenting the new feature.

Norlandz commented 2 months ago

I think there is one extension: https://github.com/basverweij/vscode-markdown-it-gridtables Its under developing. But it hasnt been updated for 5 years.