|
@@ -712,8 +712,8 @@
|
|
|
items)))
|
|
items)))
|
|
|
|
|
|
|
|
(defn- block-ast->nodes
|
|
(defn- block-ast->nodes
|
|
|
- [ctx block-ast]
|
|
|
|
|
- (let [[type data] block-ast]
|
|
|
|
|
|
|
+ [ctx block-ast']
|
|
|
|
|
+ (let [[type data] block-ast']
|
|
|
(case type
|
|
(case type
|
|
|
"Paragraph"
|
|
"Paragraph"
|
|
|
(let [children (inline-coll->nodes ctx data)]
|
|
(let [children (inline-coll->nodes ctx data)]
|
|
@@ -869,7 +869,7 @@
|
|
|
|
|
|
|
|
(defn- asset-node [block ctx]
|
|
(defn- asset-node [block ctx]
|
|
|
(let [asset-type (:logseq.property.asset/type block)
|
|
(let [asset-type (:logseq.property.asset/type block)
|
|
|
- asset-url (asset-url block ctx)
|
|
|
|
|
|
|
+ asset-url' (asset-url block ctx)
|
|
|
external-url (:logseq.property.asset/external-url block)
|
|
external-url (:logseq.property.asset/external-url block)
|
|
|
title (or (:block/title block) (str asset-type))
|
|
title (or (:block/title block) (str asset-type))
|
|
|
ext (string/lower-case (or asset-type ""))
|
|
ext (string/lower-case (or asset-type ""))
|
|
@@ -888,27 +888,27 @@
|
|
|
width
|
|
width
|
|
|
"w"))))
|
|
"w"))))
|
|
|
(string/join ", ")))]
|
|
(string/join ", ")))]
|
|
|
- (when asset-url
|
|
|
|
|
|
|
+ (when asset-url'
|
|
|
(cond
|
|
(cond
|
|
|
(contains? #{"png" "jpg" "jpeg" "gif" "webp" "svg" "bmp" "avif"} ext)
|
|
(contains? #{"png" "jpg" "jpeg" "gif" "webp" "svg" "bmp" "avif"} ext)
|
|
|
- [:img.asset-image (cond-> {:src asset-url :alt title}
|
|
|
|
|
|
|
+ [:img.asset-image (cond-> {:src asset-url' :alt title}
|
|
|
srcset (assoc :srcset srcset :sizes publish-image-sizes-attr))]
|
|
srcset (assoc :srcset srcset :sizes publish-image-sizes-attr))]
|
|
|
|
|
|
|
|
(contains? #{"mp4" "webm" "mov"} ext)
|
|
(contains? #{"mp4" "webm" "mov"} ext)
|
|
|
- [:video.asset-video {:src asset-url :controls true}]
|
|
|
|
|
|
|
+ [:video.asset-video {:src asset-url' :controls true}]
|
|
|
|
|
|
|
|
(contains? #{"mp3" "wav" "ogg"} ext)
|
|
(contains? #{"mp3" "wav" "ogg"} ext)
|
|
|
- [:audio.asset-audio {:src asset-url :controls true}]
|
|
|
|
|
|
|
+ [:audio.asset-audio {:src asset-url' :controls true}]
|
|
|
|
|
|
|
|
:else
|
|
:else
|
|
|
- [:a.asset-link {:href asset-url :target "_blank"} title]))))
|
|
|
|
|
|
|
+ [:a.asset-link {:href asset-url' :target "_blank"} title]))))
|
|
|
|
|
|
|
|
(defn block-display-node [block ctx depth]
|
|
(defn block-display-node [block ctx depth]
|
|
|
(let [display-type (:logseq.property.node/display-type block)
|
|
(let [display-type (:logseq.property.node/display-type block)
|
|
|
- asset-node (when (:logseq.property.asset/type block)
|
|
|
|
|
|
|
+ asset-node' (when (:logseq.property.asset/type block)
|
|
|
(asset-node block ctx))]
|
|
(asset-node block ctx))]
|
|
|
(case display-type
|
|
(case display-type
|
|
|
- :asset asset-node
|
|
|
|
|
|
|
+ :asset asset-node'
|
|
|
:code
|
|
:code
|
|
|
(let [lang (:logseq.property.code/lang block)
|
|
(let [lang (:logseq.property.code/lang block)
|
|
|
attrs (cond-> {:class "code-block"}
|
|
attrs (cond-> {:class "code-block"}
|
|
@@ -921,7 +921,7 @@
|
|
|
:quote
|
|
:quote
|
|
|
[:blockquote.quote-block (block-content-nodes block ctx depth)]
|
|
[:blockquote.quote-block (block-content-nodes block ctx depth)]
|
|
|
|
|
|
|
|
- (or asset-node
|
|
|
|
|
|
|
+ (or asset-node'
|
|
|
(block-content-nodes block ctx depth)))))
|
|
(block-content-nodes block ctx depth)))))
|
|
|
|
|
|
|
|
(defn block-content-from-ref [ref ctx]
|
|
(defn block-content-from-ref [ref ctx]
|
|
@@ -1085,7 +1085,7 @@
|
|
|
distinct
|
|
distinct
|
|
|
sort)))
|
|
sort)))
|
|
|
|
|
|
|
|
-(defn render-page-html
|
|
|
|
|
|
|
+(defn ^:large-vars/cleanup-todo render-page-html
|
|
|
[transit page-uuid-str refs-data tagged-nodes]
|
|
[transit page-uuid-str refs-data tagged-nodes]
|
|
|
(let [payload (publish-common/read-transit-safe transit)
|
|
(let [payload (publish-common/read-transit-safe transit)
|
|
|
meta (publish-common/get-publish-meta payload)
|
|
meta (publish-common/get-publish-meta payload)
|