mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 18:36:43 +00:00
enhance(editor): make it easier to edit page's properties (tags, alias)
This commit is contained in:
@@ -125,19 +125,6 @@
|
||||
:block/collapsed? false})
|
||||
block-ids))))
|
||||
|
||||
(defn pre-block-with-only-title?
|
||||
[repo block-id]
|
||||
(when-let [block (db/entity repo [:block/uuid block-id])]
|
||||
(let [properties (:page/properties (:block/page block))]
|
||||
(and (:title properties)
|
||||
(= 1 (count properties))
|
||||
(let [ast (mldoc/->edn (:block/content block) (mldoc/default-config (:block/format block)))]
|
||||
(or
|
||||
(empty? (rest ast))
|
||||
(every? (fn [[[typ break-lines]] _]
|
||||
(and (= typ "Paragraph")
|
||||
(every? #(= % ["Break_Line"]) break-lines))) (rest ast))))))))
|
||||
|
||||
(defn with-dummy-block
|
||||
([blocks format]
|
||||
(with-dummy-block blocks format {} {}))
|
||||
@@ -178,4 +165,4 @@
|
||||
:block/marker nil
|
||||
:block/pre-block? false})
|
||||
default-option)]
|
||||
(conj blocks dummy))))))
|
||||
(conj blocks dummy))))))
|
||||
|
||||
Reference in New Issue
Block a user