فهرست منبع

fix: can't tag a block if the tag name has spaces

Tienson Qin 2 سال پیش
والد
کامیت
60ab58c2ad

+ 1 - 1
deps/graph-parser/src/logseq/graph_parser/util.cljs

@@ -61,7 +61,7 @@
 (defn tag-valid?
   [tag-name]
   (when (string? tag-name)
-    (not (re-find #"[# \t\r\n]+" tag-name))))
+    (not (re-find #"[#\t\r\n]+" tag-name))))
 
 (defn safe-subs
   ([s start]

+ 3 - 6
src/main/frontend/components/page.cljs

@@ -292,7 +292,7 @@
   (rum/local false ::hover?)
   {:init (fn [state]
            (assoc state ::title-value (atom (nth (:rum/args state) 2))))}
-  [state page-name icon title {:keys [fmt-journal? *configure-show? built-in-property? preview? journal?]}]
+  [state page-name icon title {:keys [fmt-journal? *configure-show? built-in-property? preview?]}]
   (when title
     (let [page (when page-name (db/entity [:block/name page-name]))
           *hover? (::hover? state)
@@ -309,8 +309,7 @@
                     (date/journal-title->custom-format title)
                     title))
           old-name (or title page-name)
-          db-based? (config/db-based-graph? repo)
-          object? (= (:block/type page) "object")]
+          db-based? (config/db-based-graph? repo)]
       [:div.ls-page-title.flex-1.flex-row.w-full.relative
        {:on-mouse-over #(reset! *hover? true)
         :on-mouse-out #(reset! *hover? false)}
@@ -365,9 +364,7 @@
                   db-based?
                   (not built-in-property?)
                   (not @*edit?)
-                  (not config/publishing?)
-                  (not journal?)
-                  (not object?))
+                  (not config/publishing?))
          [:div.absolute.bottom-2.left-0
           [:div.flex.flex-row.items-center.flex-wrap.ml-2
            [:a.fade-link.flex.flex-row.items-center

+ 2 - 1
src/main/frontend/format/mldoc.cljs

@@ -144,7 +144,8 @@
            ;; tag
          (and (vector? f)
               (= "Tag" (first f)))
-         (let [tag (gp-block/get-tag f)]
+         (let [tag (-> (gp-block/get-tag f)
+                       text/page-ref-un-brackets!)]
            (swap! *result conj tag)
            nil)