How to permanently embedded a picture within a <img> tag rather than markdown ?
Hello !
I'm stylizing a KB page and managed to make my way through HTML blocks and inline style in order to show a paragraph on the left and a image on the right.
After a bit of research, I came across this post and I discovered that using attachments direct links expires after being generated.
That's a little bit unfortunate for me, knowing that in markdown, the embedding is permanent but can't be wrapped inside HTML correctly.
Right now, there's my attempt :
<div style="display:flex;">
<p style="margin-right:500px; padding-right:80px;">Content on the left<br />…</p>
<div style="margin-left:-500px; padding-right:80px;"><img src="..."/></div>
</div>Is there a workaround I didn't considered or am I required to stick to markdown in that particular case ?
Thanks a lot for your time !
Charlie.
Please sign in to leave a comment.
Hi Charlie,
There's a way to keep that image reference permanent inside your HTML block. Instead of pasting the signed URL from the "copy image link" button into
src, just use the markdown attachment reference itself as the value:<img src=""/>.YouTrack resolves this by the attachment's file name every time the article renders, generating a fresh link on the fly instead of reusing the one that eventually expires. That's why it stays permanent, same as embedding the image directly in markdown, but it works inside a raw HTML tag too.
Here's your snippet with that tweak:
Just make sure
filename.pngmatches the exact name of a file already attached to this article, otherwise the image tag ends up with no source.More on how YouTrack handles HTML blocks in Markdown here: Markdown syntax guide.
Hi ! Thank you very much for your answer !
That's brilliant ! I didn't thought that could be parsed like that.
I can resume my layout with ease ^^
Thanks a lot for your help and time !