0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/apps/default-cards/cards/html.js
Ryan McCarvill f61aa662c1 Removed ghost editor dependency (#8137)
refs #7429
- ☢️ 👷🏻‍♀️ This PR removes the dependency on Ghost-Editor and replaces it with the Mobiledoc DOM renderer. It includes new DOM based default cards and atoms.
2017-03-14 18:07:33 +00:00

12 lines
386 B
JavaScript

var SimpleDom = require('simple-dom'),
tokenizer = require('simple-html-tokenizer').tokenize,
parser;
module.exports = {
name: 'html-card',
type: 'dom',
render(opts) {
parser = new SimpleDom.HTMLParser(tokenizer, opts.env.dom, SimpleDom.voidMap);
return parser.parse('<div>' + opts.payload.html + '</div>');
}
};