Files
sgauthier 6e64e138e2
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
planning
2024-10-14 09:15:30 +02:00

25 lines
644 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use strict'
module.exports = iframe
var resolve = require('../util/resolve')
var wrapText = require('../util/wrap-text')
function iframe(h, node) {
var src = node.properties.src
var title = node.properties.title
// Only create a link if there is a title.
// We cant use the content of the frame because conforming HTML parsers treat
// it as text, whereas legacy parsers treat it as HTML, so it will likely
// contain tags that will show up in text.
if (src && title) {
return {
type: 'link',
title: null,
url: resolve(h, src),
children: [{type: 'text', value: wrapText(h, title)}]
}
}
}