Ghost/core/server/lib/mobiledoc/cards/html.js
kirrg001 5f5f0021db 🔥 Drop Node v4 Support
no issue

- support ends today
- see https://github.com/nodejs/Release
- removed `use strict`
2018-05-01 14:06:18 +02:00

22 lines
576 B
JavaScript

module.exports = {
name: 'html',
type: 'dom',
render(opts) {
let payload = opts.payload;
let dom = opts.env.dom;
let caption = '';
if (payload.caption) {
caption = `<p>${payload.caption}</p>`;
}
let html = `<div class="kg-card-html">${payload.html}${caption}</div>`;
// use the SimpleDOM document to create a raw HTML section.
// avoids parsing/rendering of potentially broken or unsupported HTML
let element = dom.createRawHTMLSection(html);
return element;
}
};