mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 19:06:21 +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:
@@ -1081,12 +1081,18 @@
|
||||
(when (uuid-string? block-id)
|
||||
(first (array-seq (js/document.getElementsByClassName block-id))))))))
|
||||
|
||||
(defonce windows-reserved-chars #"[\\/:\\*\\?\"<>|]+")
|
||||
|
||||
(defn include-windows-reserved-chars?
|
||||
[s]
|
||||
(re-find windows-reserved-chars s))
|
||||
|
||||
(defn page-name-sanity
|
||||
[page-name]
|
||||
(-> page-name
|
||||
(string/replace #"/" ".")
|
||||
;; Windows reserved path characters
|
||||
(string/replace #"[\\/:\\*\\?\"<>|]+" "_")))
|
||||
(string/replace windows-reserved-chars "_")))
|
||||
|
||||
(defn lowercase-first
|
||||
[s]
|
||||
|
||||
Reference in New Issue
Block a user