🔥 Removed deprecated markdown wrapper

This commit is contained in:
Nazar Gargol 2019-09-18 11:53:41 +02:00
parent 5def462bf0
commit 3b65081b5e
2 changed files with 0 additions and 24 deletions

View File

@ -6,7 +6,6 @@ module.exports = createCard({
render: function (opts) {
let converters = require('../converters');
let payload = opts.payload;
let version = opts.options && opts.options.version || 2;
// convert markdown to HTML ready for insertion into dom
let html = converters.markdownConverter.render(payload.markdown || '');
@ -14,13 +13,6 @@ module.exports = createCard({
return '';
}
/**
* @deprecated Ghost 1.0's markdown-only renderer wrapped cards. Remove in Ghost 3.0
*/
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);

View File

@ -43,21 +43,5 @@ describe('Markdown card', function () {
serializer.serialize(card.render(opts)).should.eql('');
});
it('[deprecated] version 1', function () {
let opts = {
env: {
dom: new SimpleDom.Document()
},
payload: {
markdown: '#HEADING\r\n- list\r\n- items'
},
options: {
version: 1
}
};
serializer.serialize(card.render(opts)).should.eql('<!--kg-card-begin: markdown--><div class="kg-card-markdown"><h1 id="heading">HEADING</h1>\n<ul>\n<li>list</li>\n<li>items</li>\n</ul>\n</div><!--kg-card-end: markdown-->');
});
});
});