LemmyNet / jerboa

A native android app for Lemmy
GNU Affero General Public License v3.0
1.17k stars 168 forks source link

Tables only render if preceded by a blank newline #1694

Closed Pab0 closed 1 month ago

Pab0 commented 1 month ago

Jerboa Version

0.0.77-gplay

Android Version + Phone

Android 13

Describe The Bug

A Markdown (GFM-extension) table that is not preceded by a newline is rendering fine on the Lemmy website, but not on Jerboa. There is a relevant issue in Markwon here: https://github.com/noties/Markwon/issues/350


For example on https://lemmy.world/post/20511191, the first table renders fine but the other two don't:

  1. Markdown source:
    
    $4:
Game Steam Link
Windowkill https://store.steampowered.com/app/2726450/Windowkill/
RUINER https://store.steampowered.com/app/464060/RUINER/
LONE RUIN https://store.steampowered.com/app/1452070/LONE_RUIN/
$10: All above, plus: Game Steam Link
OTXO https://store.steampowered.com/app/1608640/OTXO/
Go Mecha Ball https://store.steampowered.com/app/2008510/Go_Mecha_Ball/
$12: All above, plus: Game Steam Link
The Ascent - Cyber Edition https://store.steampowered.com/bundle/27166/Cyber_Edition_Bundle/
The Last Stand: Aftermath https://store.steampowered.com/app/1266840/The_Last_Stand_Aftermath/

2. Rendering on Lemmy website:
![image](https://github.com/user-attachments/assets/67cacb3d-4605-432f-b329-501b984d12fd)

3. But rendering in Jerboa:
![no_table](https://github.com/user-attachments/assets/4e414f15-3c4a-4898-8d6b-d1e921cad589)

### To Reproduce

1. Create a new post
2. Insert a Markdown (GFM) table directly after a non-blank line, e.g.
A table: col1 col2
foo foo2
bar bar2
baz baz2

3. Publish the post, or just click on "Preview"
4. The table won't render in HTML.

### In the case of a crash or when relevant include the logs

_No response_
MV-GH commented 1 month ago

This should be fixed in the markdown library. At most we can add a "hack" for this. But the library is dead so that is unlikely to happen.

More push for #1663

Pab0 commented 1 month ago

Indeed a more active markdown library would be good for any such issues in the future.

Based on this comment, multiplatform-markdown-renderer seems to not support tables yet, although adding them as a custom component might work transitionally, until they're added to the library.

dessalines commented 1 month ago

Yes, this should be handled by whatever markdown library, not here. I'm also fairly certain that commonmark should require a newline for tables anyway.