mirror of https://github.com/logseq/logseq
fix: treat special chars as invalid properties instead
parent
39b7f1bb45
commit
1830b0c082
|
@ -197,8 +197,7 @@
|
|||
k)
|
||||
k (-> (string/lower-case k)
|
||||
(string/replace " " "-")
|
||||
(string/replace "_" "-")
|
||||
(string/replace #"[\"|^|(|)|{|}]+" ""))]
|
||||
(string/replace "_" "-"))]
|
||||
(if (gp-property/valid-property-name? (str ":" k))
|
||||
(let [k' (keyword
|
||||
(if (contains? #{"custom_id" "custom-id"} k)
|
||||
|
|
|
@ -15,7 +15,11 @@
|
|||
(map #(str (name (key %)) (str colons " ") (val %)))
|
||||
(string/join "\n")))
|
||||
|
||||
(def valid-property-name? gp-util/valid-edn-keyword?)
|
||||
(defn valid-property-name?
|
||||
[s]
|
||||
[:pre (string? s)]
|
||||
(and (gp-util/valid-edn-keyword? s)
|
||||
(not (re-find #"[\"|^|(|)|{|}]+" s))))
|
||||
|
||||
(defn properties-ast?
|
||||
[block]
|
||||
|
|
Loading…
Reference in New Issue