Sfoglia il codice sorgente

fix: make-asset-url should support data url

Peng Xiao 3 anni fa
parent
commit
1b42079949
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/main/frontend/handler/editor.cljs

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

@@ -1417,8 +1417,12 @@
 (defn make-asset-url
   [path] ;; path start with "/assets" or compatible for "../assets"
   (let [repo-dir (config/get-repo-dir (state/get-current-repo))
-        path (string/replace path "../" "/")]
+        path (string/replace path "../" "/")
+        data-url? (string/starts-with? path "data:")]
     (cond
+      data-url?
+      path ;; just return the original
+      
       (util/electron?)
       (str "assets://" repo-dir path)