mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
5f5f0021db
no issue - support ends today - see https://github.com/nodejs/Release - removed `use strict`
22 lines
576 B
JavaScript
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;
|
|
}
|
|
};
|