diff --git a/src/main/frontend/handler/common.cljs b/src/main/frontend/handler/common.cljs index b852fd905..dcbc34df5 100644 --- a/src/main/frontend/handler/common.cljs +++ b/src/main/frontend/handler/common.cljs @@ -15,8 +15,9 @@ [borkdude.rewrite-edn :as rewrite])) (defn copy-to-clipboard-without-id-property! - [format content] - (util/copy-to-clipboard! (property/remove-id-property format content))) + [format raw-text html] + (util/copy-to-clipboard! (property/remove-id-property format raw-text)) + (util/copy-to-clipboard! html true)) (defn config-with-document-mode [config] diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 619cb7df2..f4c4d9d2b 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -984,7 +984,8 @@ content (compose-copied-blocks-contents repo ids) block (db/entity [:block/uuid (first ids)])] (when block - (common-handler/copy-to-clipboard-without-id-property! (:block/format block) content) + (let [html (export/export-blocks-as-html repo ids)] + (common-handler/copy-to-clipboard-without-id-property! (:block/format block) content html)) (state/set-copied-blocks content ids) (notification/show! "Copied!" :success))))) @@ -1192,9 +1193,10 @@ (when-let [block (db/pull [:block/uuid block-id])] (let [repo (state/get-current-repo) ;; TODO: support org mode - md-content (compose-copied-blocks-contents repo [block-id])] + md-content (compose-copied-blocks-contents repo [block-id]) + html (export/export-blocks-as-html repo [block-id])] (state/set-copied-full-blocks md-content [block]) - (common-handler/copy-to-clipboard-without-id-property! (:block/format block) md-content) + (common-handler/copy-to-clipboard-without-id-property! (:block/format block) md-content html) (delete-block-aux! block true)))) (defn clear-last-selected-block! @@ -2964,7 +2966,6 @@ (html-parser/convert format html) initial-text) input (state/get-input)] - ;; (def html html) (if-not (string/blank? text) (if (or (thingatpt/markdown-src-at-point input) (thingatpt/org-admonition&src-at-point input))