enhance(editor): don't show (()) for block refs

This commit is contained in:
Tienson Qin
2020-12-22 13:46:50 +08:00
parent 157365d9b5
commit 8bf6ad1654
2 changed files with 15 additions and 12 deletions

View File

@@ -374,21 +374,20 @@
(db/pull-block (uuid id)))]
(if block
[:span
[:span.text-gray-500 "(("]
[:a {:href (rfe/href :page {:name id})
:on-click (fn [e]
(.preventDefault e)
(when (gobj/get e "shiftKey")
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id block)
:block-ref
{:block block})))}
[:a
{:href (rfe/href :page {:name id})
:on-click (fn [e]
(.preventDefault e)
(when (gobj/get e "shiftKey")
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id block)
:block-ref
{:block block})))}
(->elem
:span.block-ref
(map-inline config (:block/title block)))]
[:span.text-gray-500 "))"]]
(map-inline config (:block/title block)))]]
[:span.warning.mr-1 {:title "Block ref invalid"}
(util/format "((%s))" id)]))))

View File

@@ -28,6 +28,10 @@
.block-ref {
color: var(--ls-link-text-color);
padding-bottom: 2px;
border-bottom: 0.5px solid;
border-bottom-color: var(--ls-secondary-background-color);
cursor: alias;
&:hover {
color: var(--ls-link-text-hover-color)