henriklovhaug / md-tui

Markdown renderer in the terminal
GNU Affero General Public License v3.0
206 stars 13 forks source link

Bad rendering and takes ages #160

Open nkh opened 3 weeks ago

nkh commented 3 weeks ago

try on https://github.com/nkh/P5-App-Asciio/blob/main/README.md

glow did a good job and loaded instantly while md-tui takes seconds to start displaying anything and it doesn't look good either

henriklovhaug commented 3 weeks ago

Yeah I see the issue. My grammar for markdown does not support these non-fenced code blocks. md-tui sees them are regular paragraphs and tries to format them. Not sure what the specification is there.

It is slow because it tries to fetch all the images, but the links does not point to the image address, but a GitHub page containing the image. Not really much I can do there.

nkh commented 3 weeks ago

Hi, thanks for the fast answer.

Please let me know if the MD doesn't follow specs.

You could render without the images, fetch them in the background, have a short timeout.

henriklovhaug commented 3 weeks ago

There are multiple specs out there. Other readers says they follow Github flavoured markdown for example. Maybe it should be treated as a code block. I honestly don't know.

I could maybe do a fast render without the images and let the fetching happen on a different thread. It sounds like pain to implement, but I could give it shot.

Anyhow, my current work capacity on this project is severely limited. Final year of uni and all that.