xenocrat / chyrp-markdown

A fast and extensible Markdown parser, written in PHP.
MIT License
4 stars 0 forks source link

Suggestion: add defer off-screen images for better performance #1

Open 8ctopus opened 1 week ago

8ctopus commented 1 week ago

I understand that this suggestion has nothing to do with the markdown to html conversion, however since the generated html is going to be most likely displayed. It would make sense to defer off-screen images as well as indicate width and height.

Maybe this could come as a parser option or a derived parser?

xenocrat commented 1 week ago

Hello there,

Thanks for the suggestion. Lazy-loading can be added easily as a global toggle but image dimensions would require extended syntax.

In general I don't want to go beyond the features offered by the supported Markdown flavours, but perhaps adding intrinsic dimensions to images is a good exception to that rule. I'm toying with ![alt](URL){width:height} as an extended syntax.

8ctopus commented 1 week ago

I like it.