',
)
expect(content).toContain('example.com/detail.png')
if (content.includes('target')) {
expect(content).toMatch(/target="_blank"/)
}
})
test('linked image with title on both anchor and img', async ({page}) => {
const content = await setAndGet(
page,
'
',
)
expect(content).toContain('example.com/photo.jpg')
})
test('linked image inside a paragraph with surrounding text', async ({page}) => {
const content = await setAndGet(
page,
'See the diagram:
for reference.

',
)
expect(content).not.toContain('javascript:')
})
test('multiple linked images in sequence all preserve their hrefs', async ({page}) => {
const content = await setAndGet(
page,
`
`,
)
expect(content).toContain('example.com/a.jpg')
expect(content).toContain('example.com/b.jpg')
})
})