Ver Fonte

fix: blank page when clicking empty link

Resolved #1394
Tienson Qin há 4 anos atrás
pai
commit
a2fd2e9cfe
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      src/main/frontend/components/block.cljs

+ 3 - 0
src/main/frontend/components/block.cljs

@@ -625,6 +625,9 @@
       (match url
         ["Search" s]
         (cond
+          (string/blank? s)
+          [:span.warning {:title "Invalid link"} full_text]
+
           ;; image
           (some (fn [fmt] (re-find (re-pattern (str "(?i)\\." fmt)) s)) img-formats)
           (image-link config url s label metadata full_text)