fix: don't show brackets for tags

pull/1524/head
Tienson Qin 2021-03-22 16:00:59 +08:00
parent b98e2e1dc8
commit a1f5c715d0
1 changed files with 15 additions and 13 deletions

View File

@ -572,19 +572,21 @@
["Subscript" l]
(->elem :sub (map-inline config l))
["Tag" s]
[:a.tag {:data-ref s
:href (rfe/href :page {:name s})
:on-click (fn [e]
(let [repo (state/get-current-repo)
page (db/pull repo '[*] [:page/name (string/lower-case (util/url-decode s))])]
(when (gobj/get e "shiftKey")
(state/sidebar-add-block!
repo
(:db/id page)
:page
{:page page})
(.preventDefault e))))}
(str "#" s)]
(when s
(let [s (text/page-ref-un-brackets! s)]
[:a.tag {:data-ref s
:href (rfe/href :page {:name s})
:on-click (fn [e]
(let [repo (state/get-current-repo)
page (db/pull repo '[*] [:page/name (string/lower-case (util/url-decode s))])]
(when (gobj/get e "shiftKey")
(state/sidebar-add-block!
repo
(:db/id page)
:page
{:page page})
(.preventDefault e))))}
(str "#" s)]))
["Emphasis" [[kind] data]]
(let [elem (case kind
"Bold" :b