mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
fix: can't restore page's name if it includes reserved characters
Also, fixed issues related to renaming pages
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
[medley.core :as medley]
|
||||
[frontend.format.block :as block]
|
||||
[frontend.debug :as debug]
|
||||
[clojure.string :as string]))
|
||||
[clojure.string :as string]
|
||||
[frontend.text :as text]
|
||||
[frontend.handler.common :as common-handler]))
|
||||
|
||||
(defn get-block-ids
|
||||
[block]
|
||||
@@ -35,14 +37,21 @@
|
||||
blocks (vec blocks)]
|
||||
(if (seq blocks)
|
||||
blocks
|
||||
(let [page-block (when page-name (db/entity [:block/name (string/lower-case page-name)]))
|
||||
(let [page-block (when page-name (db/pull [:block/name (string/lower-case page-name)]))
|
||||
create-title-property? (util/include-windows-reserved-chars? page-name)
|
||||
content (if create-title-property?
|
||||
(let [title (or (:block/original-name page-block)
|
||||
(:block/name page-block))
|
||||
properties (common-handler/get-page-default-properties title)]
|
||||
(text/build-properties-str format properties))
|
||||
"")
|
||||
page-id {:db/id (:db/id page-block)}
|
||||
dummy (merge {:block/uuid (db/new-block-id)
|
||||
:block/left page-id
|
||||
:block/parent page-id
|
||||
:block/page page-id
|
||||
:block/title ""
|
||||
:block/content ""
|
||||
:block/content content
|
||||
:block/format format
|
||||
:block/dummy? true}
|
||||
default-option)
|
||||
|
||||
Reference in New Issue
Block a user