[back/refactor] for -> doseq

This commit is contained in:
SouthFox 2023-08-27 13:31:37 +08:00
parent 270b4d7822
commit b0c52c2e89

View file

@ -15,13 +15,12 @@
[docs]
(-> (.select docs "style[data-emotion-css~=^[a-z0-9]*$]")
(.remove))
(vec
(for [a (.select docs "a")]
(.attr a "href"
(-> (.attr a "href")
(str/replace "https://link.zhihu.com/?target=" "")
(str/replace "https://zhuanlan.zhihu.com/p/" "#/item/")
(url-decode))))))
(doseq [a (.select docs "a")]
(.attr a "href"
(-> (.attr a "href")
(str/replace "https://link.zhihu.com/?target=" "")
(str/replace "https://zhuanlan.zhihu.com/p/" "#/item/")
(url-decode)))))
(defn clean-images
@ -30,9 +29,8 @@
(.remove))
(-> (.select docs "figure > noscript")
(.tagName "div"))
(vec
(for [img (.select docs "figure > div > img")]
(.attr img "loading" "lazy"))))
(doseq [img (.select docs "figure > div > img")]
(.attr img "loading" "lazy")))
(defn render-linkcard