|
|
@@ -34,7 +34,6 @@
|
|
|
[frontend.extensions.latex :as latex]
|
|
|
[frontend.extensions.lightbox :as lightbox]
|
|
|
[frontend.extensions.pdf.assets :as pdf-assets]
|
|
|
- [frontend.extensions.pdf.utils :as pdf-utils]
|
|
|
[frontend.extensions.sci :as sci]
|
|
|
[frontend.extensions.video.youtube :as youtube]
|
|
|
[frontend.extensions.zotero :as zotero]
|
|
|
@@ -84,7 +83,6 @@
|
|
|
[logseq.common.util.page-ref :as page-ref]
|
|
|
[logseq.db :as ldb]
|
|
|
[logseq.db.common.entity-plus :as entity-plus]
|
|
|
- [logseq.db.frontend.content :as db-content]
|
|
|
[logseq.graph-parser.block :as gp-block]
|
|
|
[logseq.graph-parser.mldoc :as gp-mldoc]
|
|
|
[logseq.graph-parser.text :as text]
|
|
|
@@ -715,9 +713,9 @@
|
|
|
|
|
|
All page-names are sanitized except page-name-in-block"
|
|
|
[state
|
|
|
- {:keys [contents-page? whiteboard-page? other-position? show-unique-title?
|
|
|
- on-context-menu with-parent? stop-event-propagation?]
|
|
|
- :or {with-parent? true}
|
|
|
+ {:keys [contents-page? whiteboard-page? other-position?
|
|
|
+ on-context-menu stop-event-propagation? with-tags?]
|
|
|
+ :or {with-tags? true}
|
|
|
:as config}
|
|
|
page-entity children label]
|
|
|
(let [*mouse-down? (::mouse-down? state)
|
|
|
@@ -780,11 +778,6 @@
|
|
|
[:span {:class (str "icon-emoji-wrap " (when emoji? "as-emoji"))}
|
|
|
icon])))
|
|
|
|
|
|
- (when (and (ldb/page? page-entity) with-parent?)
|
|
|
- (when-let [parent (:block/parent page-entity)]
|
|
|
- (when-not (ldb/library? parent)
|
|
|
- [:span.select-none (str (:block/title parent) "/")])))
|
|
|
-
|
|
|
[:span
|
|
|
(if (and (coll? children) (seq children))
|
|
|
(for [child children]
|
|
|
@@ -793,51 +786,25 @@
|
|
|
(let [{:keys [content children]} (last child)
|
|
|
page-name (subs content 2 (- (count content) 2))]
|
|
|
(rum/with-key (page-reference (assoc config :children children) page-name nil) page-name))))
|
|
|
- (let [page-component (cond
|
|
|
- (and label
|
|
|
- (string? label)
|
|
|
- (not (string/blank? label))) ; alias
|
|
|
- label
|
|
|
-
|
|
|
- (coll? label)
|
|
|
- (->elem :span (map-inline config label))
|
|
|
-
|
|
|
- show-unique-title?
|
|
|
- (block-handler/block-unique-title page-entity)
|
|
|
-
|
|
|
- :else
|
|
|
- (let [title (:block/title page-entity)
|
|
|
- s (cond untitled?
|
|
|
- (t :untitled)
|
|
|
-
|
|
|
- ;; The page-name-in-block generated by the auto-complete is not page-name-sanitized
|
|
|
- (pdf-utils/hls-file? page-name)
|
|
|
- (pdf-utils/fix-local-asset-pagename page-name)
|
|
|
-
|
|
|
- (not= (util/safe-page-name-sanity-lc title) page-name)
|
|
|
- page-name ;; page-name-in-block might be overridden (legacy))
|
|
|
-
|
|
|
- title
|
|
|
- (util/trim-safe title)
|
|
|
-
|
|
|
- :else
|
|
|
- (util/trim-safe page-name))
|
|
|
- _ (when-not page-entity (js/console.warn "page-inner's page-entity is nil, given page-name: " page-name))
|
|
|
- s (cond
|
|
|
- (not (string? s))
|
|
|
- (do
|
|
|
- (prn :debug :unknown-title-error :title s
|
|
|
- :data (db/pull (:db/id page-entity)))
|
|
|
- "Unknown title")
|
|
|
- (re-find db-content/id-ref-pattern s)
|
|
|
- (db-content/content-id-ref->page s (:block/refs page-entity))
|
|
|
- :else
|
|
|
- s)
|
|
|
- s (if (and tag? (not (:hide-tag-symbol? config))) (str "#" s) s)]
|
|
|
- (if (ldb/page? page-entity)
|
|
|
- s
|
|
|
- (block-title (assoc config :page-ref? true) page-entity {}))))]
|
|
|
- page-component))]]))
|
|
|
+ (cond
|
|
|
+ (and label
|
|
|
+ (string? label)
|
|
|
+ (not (string/blank? label))) ; alias
|
|
|
+ label
|
|
|
+
|
|
|
+ (coll? label)
|
|
|
+ (->elem :span (map-inline config label))
|
|
|
+
|
|
|
+ (ldb/page? page-entity)
|
|
|
+ (if untitled?
|
|
|
+ (t :untitled)
|
|
|
+ (let [s (util/trim-safe (block-handler/block-unique-title page-entity {:with-tags? with-tags?}))]
|
|
|
+ (if (and tag? (not (:hide-tag-symbol? config)))
|
|
|
+ (str "#" s)
|
|
|
+ s)))
|
|
|
+
|
|
|
+ :else
|
|
|
+ (block-title (assoc config :page-ref? true) page-entity {})))]]))
|
|
|
|
|
|
(rum/defc popup-preview-impl
|
|
|
[children {:keys [*timer *timer1 visible? set-visible! render *el-popup]}]
|
|
|
@@ -3302,8 +3269,7 @@
|
|
|
(let [parents-props (doall
|
|
|
(for [{:block/keys [uuid name title] :as block} parents]
|
|
|
(if name
|
|
|
- [block (page-cp {:disable-preview? true
|
|
|
- :with-parent? false} block) true]
|
|
|
+ [block (page-cp {:disable-preview? true} block) true]
|
|
|
(let [result (block/parse-title-and-body
|
|
|
uuid
|
|
|
(get block :block/format :markdown)
|