Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function imageReference (h, node) {
const def = h.definition(node.identifier)
if (!def) {
return revert(h, node)
}
const props = { src: normalize(def.url || ''), alt: node.alt }
if (def.title !== null && def.title !== undefined) {
props.title = def.title
}
return h(node, 'img', props)
}
export default function linkReference (h, node) {
const def = h.definition(node.identifier)
if (!def) {
return revert(h, node)
}
const props = { href: normalize(def.url || '') }
if (def.title !== null && def.title !== undefined) {
props.title = def.title
}
return h(node, 'a', props, all(h, node))
}