Selaa lähdekoodia

fix: dwiw paste in markdown source block

llcc 3 vuotta sitten
vanhempi
sitoutus
2d8047de7f

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

@@ -2964,7 +2964,8 @@
     (let [text (.getData (gobj/get e "clipboardData") "text")
           input (state/get-input)]
       (if-not (string/blank? text)
-        (if (thingatpt/org-admonition&src-at-point input)
+        (if (or (thingatpt/markdown-src-at-point input)
+                (thingatpt/org-admonition&src-at-point input))
           (when-not (mobile-util/native-ios?)
             (util/stop e)
             (paste-text-in-one-block-at-point))

+ 1 - 1
src/main/frontend/util/thingatpt.cljs

@@ -147,7 +147,7 @@
                      :name name
                      :end (+ (:end admonition&src) (count name))))))))
 
-(defn- markdown-src-at-point [& [input]]
+(defn markdown-src-at-point [& [input]]
   (when-let [markdown-src (thing-at-point ["```" "```"] input)]
     (let [language (-> (:full-content markdown-src)
                        string/split-lines