# Smart(er) paste HTML to md

**URL:** <https://discourse.devontechnologies.com/t/smart-er-paste-html-to-md/62067>\
**Category:** DEVONthink\
**Created:** [February 16, 2021, 5:06pm UTC](https://discourse.devontechnologies.com/t/smart-er-paste-html-to-md/62067 "2021-02-16T17:06:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![laudunum](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/l/b3f665/32.png) [@laudunum](https://discourse.devontechnologies.com/u/laudunum)\
**Post date:** [February 16, 2021, 5:06pm UTC](https://discourse.devontechnologies.com/t/smart-er-paste-html-to-md/62067/1 "2021-02-16T17:06:33Z")

</div>

I am a Keyboard Maestro user, so I am taking a look at building a [macro for this](https://forum.keyboardmaestro.com/t/convert-html-to-markdown-in-buffer-for-pasting/10920/7), but having seen that some apps, e.g. Obsidian (but others too), handle the copy/paste from HTML to Markdown seemingly seamlessly, I was wondering what they are doing in the background and if there are plans to implement such things in Devonthink? The current service is broken or non-functional in that it does not capture links at all:

 ![Screen Shot 2021-02-16 at 11.04.12](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/2/3/23a4065709fc1ded0c5fe3b371429c19e1b890cb.jpeg)

Moreover, in many instances, I do not want to create a new document, I simply want to capture something, sometimes on the web or in the instance above in an HTML-formatted email, and paste it into a document on which I am working.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [February 18, 2021, 11:44am UTC](https://discourse.devontechnologies.com/t/smart-er-paste-html-to-md/62067/2 "2021-02-18T11:44:23Z")

</div>

I fiddled around a bit and came up with this possible solution:

> [@Bookmarklet to convert HTML selection to Markdown](https://discourse.devontechnologies.com/t/bookmarklet-to-convert-html-selection-to-markdown/62170):
>
> Since somebody asked in [another thread](https://discourse.devontechnologies.com/t/smart-er-paste-html-to-md/62067) about the possibility to convert parts of a HTML document to Markdown including links etc.: I fiddled around a bit and came up with this bookmarklet: javascript:(() =\> { const script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://unpkg.com/turndown/dist/turndown.js"; script.async = false; script.defer = false; document.head.appendChild(script); script.addEventListener('load', () =\> { const sel = window.getSelecti…

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [February 18, 2021, 2:13pm UTC](https://discourse.devontechnologies.com/t/smart-er-paste-html-to-md/62067/3 "2021-02-18T14:13:39Z")

</div>

The next release will both improve pasting into documents and the _Create Markdown Document_ service.
