0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/lib/mobiledoc/cards/html.js
Kevin Ansfield df1188d25a
Fix Node.js 4.x compatibility (#9503)
no issue
- fixes compatibility issue introduced in 7548ace32d
2018-03-15 09:50:25 +00:00

23 lines
591 B
JavaScript

'use strict';
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;
}
};