This is not due to the template as you can see in the HTML section of your note that a link is not wrap in a <a></a>
tag but in <p></<p>
tag.
I have updated the template to account for this and replace any valid url wrapped in a <p></<p>
tag into <a></a>
tag by using the following regex:
replace('<p>(https?:\/\/.+)<\/p>', '<a href=\\"$1\\" class=\\"link-external\\">$1</a>')
Additionally, for me not having the image exported into DEVONThink was a deal breaker, so I found the following workflow that works quite well:
- Store the images in a DT database
- Drag an image to a TB note
- Copy the DT link and paste it right below the image
- You can add a class to the image if you need by adding
|| .link-dt
So the text below the images looks like:
x-devonthink-item://E85F32FD-211E-4EE8-AA1B-9A7AA502D5E9 || .link-dt
The output will be:
<img src="x-devonthink-item://E85F32FD-211E-4EE8-AA1B-9A7AA502D5E9" class="link-dt" />
You can also omit the || .link-dt
I like the idea to store the original image with the full quality in DT, and upon dragging into the TB note, having a reduced quality image just for viewing in the TB note. You can also add a middle step where you resize manually the image outside DT and before dragging into TB but still link to the original DT image by using the DT item link.
Note that images with no DT item directly below will not be processed and not viewable in DT upon export.
Because the TBX document file size grows very fast (is that a bug? If I drop a 34kB image in a note, the document size grows from 50kb to 5MB???), there is also a third options to show a DT image only after export:
For this, you don’t drag the image to TB but instead just copy the DT link id and paste as follow somewhere in your note:
@img: x-devonthink-item://E85F32FD-211E-4EE8-AA1B-9A7AA502D5E9 || .link-dt
@img: x-devonthink-item://E85F32FD-211E-4EE8-AA1B-9A7AA502D5E9
Again you may or may not use a class as am option for your image
New template:
publish-tinderbox-to-devonthink-0.5.4.tbx (205.0 KB)