mirror of https://github.com/logseq/logseq
Enhance/plugin APIs x (#10022)
* fix(apis): validate non-empty uuid input for query block * fix(plugin): missing block data for the nested renderer macro hook * fix(plugin): incorrect block config for the query table block itemspull/10078/head
parent
6ce6b1933c
commit
583a3d5dc8
|
@ -952,7 +952,7 @@
|
|||
(if (and (not paragraph?)
|
||||
(mldoc/block-with-title? (ffirst ast)))
|
||||
(markup-elements-cp (assoc config :block/format format) ast)
|
||||
(inline-text format macro-content)))
|
||||
(inline-text config format macro-content)))
|
||||
[:span.warning {:title (str "Unsupported macro name: " name)}
|
||||
(macro->text name arguments)])])
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
(defn- build-column-value
|
||||
"Builds a column's tuple value for a query table given a row, column and
|
||||
options"
|
||||
[row column {:keys [page? ->elem map-inline config comma-separated-property?]}]
|
||||
[row column {:keys [page? ->elem map-inline comma-separated-property?]}]
|
||||
(case column
|
||||
:page
|
||||
[:string (if page?
|
||||
|
@ -129,13 +129,14 @@
|
|||
|
||||
:block ; block title
|
||||
(let [content (:block/content row)
|
||||
uuid (:block/uuid row)
|
||||
{:block/keys [title]} (block/parse-title-and-body
|
||||
(:block/uuid row)
|
||||
(:block/format row)
|
||||
(:block/pre-block? row)
|
||||
content)]
|
||||
(if (seq title)
|
||||
[:element (->elem :div (map-inline config title))]
|
||||
[:element (->elem :div (map-inline {:block/uuid uuid} title))]
|
||||
[:string content]))
|
||||
|
||||
:created-at
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
[id-or-uuid ^js opts]
|
||||
(when-let [block (if (number? id-or-uuid)
|
||||
(db-utils/pull id-or-uuid)
|
||||
(db-model/query-block-by-uuid (sdk-utils/uuid-or-throw-error id-or-uuid)))]
|
||||
(and id-or-uuid (db-model/query-block-by-uuid (sdk-utils/uuid-or-throw-error id-or-uuid))))]
|
||||
(when-not (contains? block :block/name)
|
||||
(when-let [uuid (:block/uuid block)]
|
||||
(let [{:keys [includeChildren]} (bean/->clj opts)
|
||||
|
|
Loading…
Reference in New Issue