Closed Kaned1as closed 6 years ago
Hello @Adonai (again) !
I cannot reproduce the issue. Can you please additionally log (for inspection purposes) raw markdown that is being processed? There might be some issue with trimIdent
or file reading mechanism (some encoding issues, different new line characters, etc) or, hell, both 😃 .
Sure, give me an hour, will post once I'm home
This is the raw text:
But adding just text before or after the table causes it to collapse
| One ring | Patterns | Titanic | | | |
|-----------------------------|--------------------------|-----------------------------------|---|---|---|
| One ring to rule them all |There's one for the sorrow| Roll on, Titanic, roll | | | |
| One ring to find them | And two for the joy |You're the pride of White Star Line| | | |
| One ring to bring them all | And three for the girls | Roll on, Titanic, roll | | | |
|And in the darkness bind them| And four for the boys | Into the mists of time | | | |
Possibly the problem is in commonmark parser
Hey! The thing is it looks like a table needs a proper delimiter. For example, I'm using Github markdown here (using the text you have provided):
But adding just text before or after the table causes it to collapse | One ring | Patterns | Titanic | |||
---|---|---|---|---|---|---|
One ring to rule them all | There's one for the sorrow | Roll on, Titanic, roll | ||||
One ring to find them | And two for the joy | You're the pride of White Star Line | ||||
One ring to bring them all | And three for the girls | Roll on, Titanic, roll | ||||
And in the darkness bind them | And four for the boys | Into the mists of time |
and here with an additional new line after the header:
But adding just text before or after the table causes it to collapse
One ring | Patterns | Titanic | |||
---|---|---|---|---|---|
One ring to rule them all | There's one for the sorrow | Roll on, Titanic, roll | |||
One ring to find them | And two for the joy | You're the pride of White Star Line | |||
One ring to bring them all | And three for the girls | Roll on, Titanic, roll | |||
And in the darkness bind them | And four for the boys | Into the mists of time |
So, as in markdown one new line is not considered really a new line, parser thinks that you are just trying to ident your text. Adding another new line will fix your test case
Ok, now I just should somehow explain it to my users...
Thanks though :)
Tough one, good luck! 😃
Table spans are quite brittle, the don't survive additions of simple text content before them. This test-case outlines that (written in Kotlin, hope you don't mind).
contents of sample table:
This test fails on the last assert for me.