When I thought how to do truncated diary entries I first considered doing it
server-side. I already go through markdown parse trees in the richtext library
to get images and descriptions for Open Graph tags. I can probably extend that
to generate truncated entries.
Then I thought that ultimately I want to limit entry heights. Isn't it easier
to ask the browser what height each element is instead of trying to estimate it
server-side? And if there's an image, it usually doesn't have its height
specified in the source markdown code, therefore I can't know it server-side
but client-side I can.
But it's not that simple. Images can load any time, including never. I'd have
to listen to load events to recalculate the heights. Now it doesn't look like a
good idea. Let's suppose there's a large image and some text below. Before the
image is loaded that text fits in the truncated view. Am I going to remove the
text after the image loads, possibly when the user is reading it? I guess it's
better to estimate heights and truncate server-side.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5121#issuecomment-2353504228
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5121/c2353504...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev