This commit is contained in:
erik 2024-05-28 18:20:20 +02:00
parent daf9149b04
commit 1e1eb7786e
2 changed files with 6 additions and 4 deletions

View file

@ -65,8 +65,8 @@
(defn insert-into-post [item index insertion-element]
(let [condition (if (vector? item)
(every? true? [(= (first item) :section)
(= (:class (second item)) "mastodon-post-content")])
(every? true? [(= (first item) :article)
(= (:class (second item)) "mastodon-post")])
false)]
(if condition
(insert item index insertion-element)
@ -79,7 +79,7 @@
html))
(defn insert-link-prev [html]
(postwalk #(insert-into-post % 3 link_preview) html))
(postwalk #(insert-into-post % 4 link_preview) html))
(defn masto-link-prev->html [html card]
(let [{:keys [url image title description]} card]

View file

@ -127,7 +127,9 @@
[:section
{:class "mastodon-post-content"}
[:p {:class "mastodon-post-text"} "POST_TEXT"]
[:img {:class "mastodon-post-image", :src "POST_IMG_URL"}]]
[:img
{:class "mastodon-post-image",
:src "https://cdn.masto.host/socialmeissagmbhde/media_attachments/files/112/432/505/467/393/505/small/0d01ddb07440328e.jpg"}]]
[:footer
{:class "mastodon-post-footer"}
[:button