markdown-preview-enhanced icon indicating copy to clipboard operation
markdown-preview-enhanced copied to clipboard

How to display empty cell with extended table syntax?

Open macchaka opened this issue 3 years ago • 3 comments

Thank you for your greatful extension. I can't work without this. Lovely!

I want merge cells with by left-side cell. I know the syntax has variety by the software.

I hope only case of no-space to be merge with left-side. If there are space, it means empty cell.

But this extension merge either case.

Is there other way to display empty cell?

example

|X   |Y  |
|----|---|
|A   |10 |
|B   |   |
|C      ||

my hope

screenshot 2021-09-16 150705

actual

screenshot 2021-09-16 150919

I'm using the following on Windows10,

  • Version 0.19.0 on Atom
  • Version 0.6.0 on VS Code

macchaka avatar Sep 16 '21 06:09 macchaka

If you use math syntax, you can use $\!$ to replace space. For example

|X   |Y  |
|----|---|
|A   |10 |
|B   | $\!$ |
|C      ||

It will achieve your hope.

Also, you can use others like $\,$, $\quad$ and so on. They all means space in math mode.

pilgrimlyieu avatar Sep 20 '21 13:09 pilgrimlyieu

Thanks for your help. It is a greatful only answer.

I wish that markdown should be human friendly to read without rendering. I don't understand the benefits of treating blank cells as merged cells I think it is more rational a specification that merge the cell on the right side by continuing the pipe without inserting a blank.

Markdown preview enhanced is most useful preview renderer for me. I entered be sponcer to support continus improvement even if this issue to be rejected.

macchaka avatar Dec 15 '21 15:12 macchaka

I hope a new option to add render specification on "extended table syntax" that empty cell not means to be merged with left side.
Because I think "markdown preview enhanced" is defact standard, and I can make finished my work only use this one.
So I think that this option is very useful to us even if other software rule is not be changed.

Thank you for reading this issue.

macchaka avatar May 25 '22 01:05 macchaka

I had the same issue myself and was looking to see if this was being addressed.

@macchaka In the meantime you could use this in the parser.js file: https://github.com/shd101wyy/markdown-preview-enhanced/blob/master/docs/usages.md

// Keep empty tables as empty tables (|    | -> |   |)
markdown = markdown.replace(/\| {2,}/gm, ($0) => '|  ')

thiskurt avatar Nov 02 '22 14:11 thiskurt