소스 검색

fix: use clipboard text if html->hiccup failed

Tienson Qin 3 년 전
부모
커밋
1748beb7b4
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/main/frontend/handler/editor.cljs

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

@@ -2987,7 +2987,11 @@
           format (or (:block/format edit-block) :markdown)
           initial-text (.getData clipboard-data "text")
           text (if-not (string/blank? html)
-                 (html-parser/convert format html)
+                 (try
+                   (html-parser/convert format html)
+                   (catch :default e
+                     (log/error :html->hiccup e)
+                     initial-text))
                  initial-text)
           input (state/get-input)]
       (if-not (string/blank? text)