Ghost/core/server/lib/mobiledoc/cards/html.js
Kevin Ansfield 367c5b9639 Koenig - Fixed empty HTML card rendering undefined
refs https://github.com/TryGhost/Ghost/issues/9623
- add tests for undefined payloads in container cards
- add guard for undefined payload in html card
2018-05-15 10:09:52 +01:00

14 lines
365 B
JavaScript

module.exports = {
name: 'html',
type: 'dom',
render(opts) {
if (!opts.payload.html) {
return '';
}
// use the SimpleDOM document to create a raw HTML section.
// avoids parsing/rendering of potentially broken or unsupported HTML
return opts.env.dom.createRawHTMLSection(opts.payload.html);
}
};