0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/lib/mobiledoc/cards/markdown.js
kirrg001 dd668892d7 Removed more 'use strict' usages
no issue

- after we have dropped node 4, we have removed all 'use strict' usages
- but they came back from older pull requests
2018-06-02 21:38:11 +02:00

20 lines
742 B
JavaScript

module.exports = {
name: 'markdown',
type: 'dom',
render: function (opts) {
let converters = require('../converters');
let payload = opts.payload;
let version = opts.options.version;
// convert markdown to HTML ready for insertion into dom
let html = converters.markdownConverter.render(payload.markdown || '');
// Ghost 1.0's markdown-only renderer wrapped cards
if (version === 1) {
html = `<div class="kg-card-markdown">${html}</div>`;
}
// use the SimpleDOM document to create a raw HTML section.
// avoids parsing/rendering of potentially broken or unsupported HTML
return opts.env.dom.createRawHTMLSection(html);
}
};