mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
d0dc7c5ee1
no issue - Renames Cards so they comply with the `card-{{name}}` convention rather than `{{name}}-card` - Adds an unkonwnCardHandler to the editor.
14 lines
586 B
JavaScript
14 lines
586 B
JavaScript
var SimpleDom = require('simple-dom'),
|
|
tokenizer = require('simple-html-tokenizer').tokenize,
|
|
Showdown = require('showdown-ghost'),
|
|
converter = new Showdown.converter({extensions: ['ghostgfm', 'footnotes', 'highlight']}),
|
|
parser;
|
|
|
|
module.exports = {
|
|
name: 'card-markdown',
|
|
type: 'dom',
|
|
render(opts) {
|
|
parser = new SimpleDom.HTMLParser(tokenizer, opts.env.dom, SimpleDom.voidMap);
|
|
return parser.parse('<div class="kg-card-markdown">' + converter.makeHtml(opts.payload.markdown || '') + '</div>');
|
|
}
|
|
};
|