mirror of https://github.com/logseq/logseq
fix: new class should always set :block/type to "class"
New change with :block/type "page" was causing :tag-classes option to fail. Part of LOG-3176feat/asset-sync
parent
95ebc1e805
commit
3d732cb018
|
@ -110,12 +110,11 @@
|
|||
[block]
|
||||
{:pre [(qualified-keyword? (:db/ident block))]}
|
||||
(block-with-timestamps
|
||||
(merge (cond->
|
||||
{:block/type (set (concat (:block/type block) ["class" "page"]))
|
||||
:block/format :markdown}
|
||||
(not= (:db/ident block) :logseq.class/Root)
|
||||
(assoc :class/parent :logseq.class/Root))
|
||||
block)))
|
||||
(cond-> (merge block
|
||||
{:block/type (set (concat (:block/type block) ["class" "page"]))
|
||||
:block/format :markdown})
|
||||
(not= (:db/ident block) :logseq.class/Root)
|
||||
(assoc :class/parent :logseq.class/Root))))
|
||||
|
||||
(defn build-new-page
|
||||
"Builds a basic page to be transacted. A minimal version of gp-block/page-name->map"
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
(is (= (:block/content block) "Inception")
|
||||
"tagged block with configured tag strips tag from content")
|
||||
|
||||
(is (= ["class"] (:block/type tag-page))
|
||||
(is (= ["class" "page"] (:block/type tag-page))
|
||||
"configured tag page in :tag-classes is a class")
|
||||
(is (and another-tag-page (not (contains? (set (:block/type another-tag-page)) "class")))
|
||||
"unconfigured tag page is not a class")
|
||||
|
|
Loading…
Reference in New Issue