浏览代码

fix: avoid press enter at empty page-ref

Andelf 3 年之前
父节点
当前提交
2220208c50
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/main/frontend/handler/editor.cljs

+ 1 - 1
src/main/frontend/handler/editor.cljs

@@ -2427,7 +2427,7 @@
               "admonition-block" (keydown-new-line)
               "source-block" (keydown-new-line)
               "block-ref" (open-block-in-sidebar! (:link thing-at-point))
-              "page-ref" (do
+              "page-ref" (when-not (string/blank? (:link thing-at-point))
                            (insert-first-page-block-if-not-exists! (:link thing-at-point))
                            (route-handler/redirect-to-page! (:link thing-at-point)))
               "list-item"