The challenge here is not simply to get links, but, reading between the lines, to get renderable links. Let’s assume that this the case and it is for a preview. You have to have the image available via a web request when the preview resolves it. If you are able to login to a session, then you can do that and then view any previewed Markdown. But invariably you have to be using a full on browser implementation for that.
When developing on a desktop, a local web server is usually how this is dealt with. The same can be enabled on iPadOS, though not iOS. On an iPad, you can run apps in split screen, and there are many apps out there that can host files and serve them locally.
For example, in the past, I’ve tested this out running GoodReader and Drafts side-by-side. I’ve hosted image files in GoodReader (with the web serving feature enabled), copied the link, used that in my image markdown in Drafts, and have then been able to successfully preview the Markdown, including images in Drafts.
Prior to publishing I then used a Drafts action to find and replace for where the image files were eventually going to reside.
When publicly sharing an image file from iCloud, the resulting web page gives a download option, but not a simple link (like Dropbox), so I’m not sure there’s going to be a way to easily set such an image as an available online source directly. I can see a lot of Cloud Kit JavaScript code behind it, so while it may well be possible to extrapolate the link, I don’t think it’s a trivial step to do so.
Therefore, if this is not simply for preview, but for publishing, I would go with an invariably simpler approach of uploading the images to the final destination, and then updating if any revisions are required. That potentially takes out a lot of the issues outright; except if you are offline, in which case the preview option above is what I came up with as viable for such occasions.
Hope that helps.