import { createImgTagHtml } from './createImgTagHtml.ts'
import { getImageInfo } from './getImageInfo.ts'
export function createImgTagMd(imgInfo: ReturnType): string {
const { needHtmlTag, attrs, targetUrl } = imgInfo
if (needHtmlTag) {
return createImgTagHtml(imgInfo)
}
const alt = attrs.get('alt')
const src = attrs.get('src')
const imgTag = ``
if (targetUrl) {
return `[${imgTag}](${targetUrl})`
} else {
return imgTag
}
}