markdown-it-multimd-table icon indicating copy to clipboard operation
markdown-it-multimd-table copied to clipboard

Multiline functionality v3 vs v4

Open oldrich-svec opened this issue 3 years ago • 6 comments

For the following:

     x     |    x
-----------|-----------
test1      | test2 \
           |  \
           | test3

v3.1.3 produces:

image

whereas v4.0.3 gives:

image

Is it a regression bug or a feature? 😊

oldrich-svec avatar Mar 11 '21 12:03 oldrich-svec

Yes, that's a bug. It seems caused by incorrect pipes scanning, as done in 6b2c2ea. And I may fix this in few days.

redbug312 avatar Mar 14 '21 14:03 redbug312

@RedBug312 What is the current status on this bug? I need some of the functionality in version 4 of multimd-table, but I can't update it before the bug has been fixed, since my code would otherwise break.

dk-teknologisk-mnm avatar Apr 14 '21 09:04 dk-teknologisk-mnm

@dk-teknologisk-mnm Sorry for the long delay, I was busy with other things and have no time to check until recently. This bug is fixed and published as v4.1.0.

redbug312 avatar Apr 15 '21 10:04 redbug312

No worries and thank you for fixing the bug. It seems to work as it should. :-) I did encounter another thing.

    1     |     2
----------|----------
Test 1    |          \
          | Result 1 \
          | 
Test 2    | Result 1 \
          |          \
          | Result 2 \
          |

When I write the above I expect it to give:

1                    2

Test 1               Result 1
Test 2               Result 1 Result 2

But instead it does not render 'Result 1' in 'Test' 1 at all:

1                     2

Test 1		
Test 2                Result 4 Result 5

Is this a bug or is it expected behaviour?

dk-teknologisk-mnm avatar Apr 16 '21 09:04 dk-teknologisk-mnm

It's an implementation bug. Because the current parser assumes: The first line of a multi-line contains exactly the number of cells.

So the 2nd cell of the fourth line got ignored, as the third line contains 1 cell only (slash excluded). But since the assumption really simplifies the code, I'll leave this open until there's a simple solution to this bug.

redbug312 avatar Apr 20 '21 12:04 redbug312

Okay. If it can be of any use, here is an explanation of the use-case where I get the bug. I have a table where I have several if-statements. In order to make it readable this spans over several lines in the table. So it would look like this:

   1   |   2
------ | ------
Test 1 | {{#if something}} \
       | Text 1            \
       | {{else}}          \
       | Text 2            \
       | {{/if}}

... which if statement is true then becomes this in markdown:

   1   |   2
------ | ------
Test 1 |          \
       | Text 1   \
       |          \
       |          \
       | 

So this is why I get the bug.

dk-teknologisk-mnm avatar Apr 21 '21 12:04 dk-teknologisk-mnm