Html admin api incorrectly parse figure with a href as img

I have figure with link:

<figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href=""><div class="kg-bookmark-content"><div class="kg-bookmark-title">Install MongoDB Community Edition on Red Hat or CentOS — MongoDB Manual</div><div class="kg-bookmark-description"></div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src=""></div></div><div class="kg-bookmark-thumbnail"><img src=""></div></a></figure>

When I am using /ghost/api/admin/posts/?source=html then this is parsed as

<figure class="kg-card kg-image-card"><img src="" class="kg-image" alt="" loading="lazy"></figure>

and my url is lost

1 Like

I have the same issue.

Ghost version- 5.75.2
@tryghost/admin-api- 1.13.2

Code to reproduce:

const postsRaw = await api.posts.browse({ formats: 'html', limit: 'all' })
for await (const post of postsRaw) {
    try {
		await api.posts.edit({ id:, updated_at: post?.updated_at, html: post.html }, { source: 'html' })
	} catch (e) {
		console.log(`Error while updating post ${(}!`, e)