mikepenz / multiplatform-markdown-renderer

Markdown renderer for Kotlin Multiplatform Projects (Android, iOS, Desktop), using Compose.
https://mikepenz.github.io/multiplatform-markdown-renderer/
Apache License 2.0
387 stars 25 forks source link

Tables and dividers don't render properly #99

Open kenyee opened 9 months ago

kenyee commented 9 months ago

About this issue

This doesn't seem to render hrules/divider or tables properly..otherwise, it works great!

Example markdown:

--------------------------------------------------------------------------
A/B Test Cells (All) number is percentage of crashes with user in test cell:
----------------------------------------------------------------------------

|Test ID|Cell|% users|
|-------|----|-------
| 55977 | 6 | 15% |
| 55085 | 4 | 14% |
| 56835 | 10 | 13% |
| 57360 | 9 | 12% |

The hrule/divider makes the text within get rendered at a very large size. And the table doesn't show up:

Screenshot 2024-01-05 at 10 28 56 AM

I checked the IntelliJ library that this library uses and it appears to support tables so I'm guessing this library doesn't handle them? If so, it should be documented in the Readme.md.

Details

Checklist

mikepenz commented 8 months ago

Thank you very much for the report @kenyee

You can find all current handled node types here: https://github.com/mikepenz/multiplatform-markdown-renderer/blob/develop/multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/compose/Markdown.kt#L86-L106

And yes you are correct, tables are currently not yet handled. It is however possible to implement a custom component which adds support for these.

That said, I am happy to review contributions adding proper table support to the library!


Related the hrule/divider. yes the divider on top is not shown, however the line below the text would make it a header. Which based on your screenshot looks correct. See the markdown example below:

h1

h2


A/B Test Cells (All) number is percentage of crashes with user in test cell: