mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
no issue - the begin/end comments are only really useful when wrapping free-form content cards such as html and markdown, the rest all have specific elements and classes that can be used in parsers - made the comment wrappers optional in the `render()` function created by the `createCard()` factory - opted into comment wrappers for the html and markdown cards
18 lines
474 B
JavaScript
18 lines
474 B
JavaScript
const createCard = require('../create-card');
|
|
|
|
module.exports = createCard({
|
|
name: 'html',
|
|
type: 'dom',
|
|
config: {
|
|
commentWrapper: true
|
|
},
|
|
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);
|
|
}
|
|
});
|