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 link (h, node) {
let tagName
const url = normalize(node.url)
const props = {}
if (node.title !== null && node.title !== undefined) {
props.title = node.title
}
if (url.startsWith('#') || url.match(/^https?:\/\//)) {
props.href = url
tagName = 'a'
} else {
props.to = url
tagName = 'nuxt-link'
props['data-press-link'] = 'true'
}
return h(node, tagName, props, all(h, node))
export default function image (h, node) {
const props = {
src: normalize(node.url),
alt: node.alt
}
if (node.title !== null && node.title !== undefined) {
props.title = node.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))
}