Browse Source

fix: for file graphs, tags with blank space in the namespace parent

creates entities with nil :block/title to be created. This
created unexpected bugs in the UI e.g. all pages and
caused duplicate content to appear.
Example from test graph: 'tags:: [[Some / Namespace ]]'
Fixes
https://test.logseq.com/#/page/68017fb5-7b9c-448a-9f64-6bb8d8669396
Gabriel Horner 6 months ago
parent
commit
4ad4944b4e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      deps/graph-parser/src/logseq/graph_parser/block.cljs

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

@@ -345,7 +345,7 @@
               (when namespace?
                 (let [namespace' (first (common-util/split-last "/" original-page-name))]
                   (when-not (string/blank? namespace')
-                    {:block/namespace {:block/name (common-util/page-name-sanity-lc namespace')}})))
+                    {:block/namespace {:block/name (string/trim (common-util/page-name-sanity-lc namespace'))}})))
               (when (and with-timestamp? (or skip-existing-page-check? (not page-entity))) ;; Only assign timestamp on creating new entity
                 (let [current-ms (common-util/time-ms)]
                   {:block/created-at current-ms