From dec7d3f7fee16c75c45dd645398bb84191a03776 Mon Sep 17 00:00:00 2001 From: Swrup Date: Tue, 22 Feb 2022 10:23:34 +0100 Subject: [PATCH] fix link on preview not working but now we cant clcik the image, css is a nightmare --- src/content/assets/css/style.css | 3 --- src/pp_babillard.ml | 37 +++++++++++--------------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/src/content/assets/css/style.css b/src/content/assets/css/style.css index 01eb885..031fb00 100644 --- a/src/content/assets/css/style.css +++ b/src/content/assets/css/style.css @@ -111,9 +111,6 @@ blockquote.blockquote { } a.preview-link { - display: block; - height: 100; - width: 100; text-decoration: none; color: unset; } diff --git a/src/pp_babillard.ml b/src/pp_babillard.ml index d272f9a..101562e 100644 --- a/src/pp_babillard.ml +++ b/src/pp_babillard.ml @@ -111,38 +111,27 @@ let pp_post fmt t = ~some:(fun thread_data -> thread_data.subject) thread_data_opt in - (* put inside a link if its a preview *) - let pp_inner_post fmt () = - Format.fprintf fmt - {| + (* put a link in if its a preview *) + let link fmt () = + if Option.is_some thread_data_opt then + Format.fprintf fmt + {||} id + else Format.fprintf fmt "" + in + Format.fprintf fmt + {| +
%s
%a %a + %a
%s
%a +
|} - subject post_info_view () image_view () comment tags_view () - in - if Option.is_some thread_data_opt then - Format.fprintf fmt - {| -
- - %a - -
- |} - id id pp_inner_post () - else - Format.fprintf fmt - {| -
- %a -
- |} - id pp_inner_post () + id subject link () post_info_view () image_view () comment tags_view () let view_post id = let* post = get_post id in