mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-04 12:44:57 +03:00
bcf5a1bc34
refs #9178 * Add eslint deps, remove old lint deps * Add eslint config, remove old lint configs * Config for server and tests are different * Tweaked rules to suit us * Fix linting in codebase - lots of indent changes. * Fix a real broken test
20 lines
644 B
JavaScript
20 lines
644 B
JavaScript
module.exports = {
|
|
name: 'card-markdown',
|
|
type: 'dom',
|
|
render: function (opts) {
|
|
var markdownConverter = require('../../../utils/markdown-converter'),
|
|
html, element;
|
|
|
|
// convert markdown to HTML ready for insertion into dom
|
|
html = '<div class="kg-card-markdown">'
|
|
+ markdownConverter.render(opts.payload.markdown || '')
|
|
+ '</div>';
|
|
|
|
// use the SimpleDOM document to create a raw HTML section.
|
|
// avoids parsing/rendering of potentially broken or unsupported HTML
|
|
element = opts.env.dom.createRawHTMLSection(html);
|
|
|
|
return element;
|
|
}
|
|
};
|