markdown-it-multimd-table
markdown-it-multimd-table copied to clipboard
Multiline functionality v3 vs v4
For the following:
x | x
-----------|-----------
test1 | test2 \
| \
| test3
v3.1.3 produces:
whereas v4.0.3 gives:
Is it a regression bug or a feature? 😊
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 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 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.
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?
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.
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.