mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
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.
31 lines
965 B
JavaScript
31 lines
965 B
JavaScript
var converter = require('../../../server/utils/mobiledoc-converter');
|
|
|
|
describe('Convert mobiledoc to HTML ', function () {
|
|
var mobiledoc = {
|
|
version: '0.3.1',
|
|
atoms: [],
|
|
cards: [
|
|
['markdown-card',
|
|
{
|
|
pos: 'top',
|
|
card_name: 'markdown-card',
|
|
markdown: '#heading\n\n- list one\n- list two\n- list three'
|
|
}
|
|
],
|
|
['markdown-card', {
|
|
pos: 'top'
|
|
}]
|
|
],
|
|
markups: [],
|
|
sections: [
|
|
[1, 'p', [
|
|
[0, [], 0, 'test']
|
|
]],
|
|
[10, 0],
|
|
[10, 1]
|
|
]
|
|
};
|
|
it('Converts a mobiledoc to HTML', function () {
|
|
converter.render(mobiledoc).should.match('<p>test</p><div><h1 id="heading">heading</h1>\n\n<ul>\n<li>list one</li>\n<li>list two</li>\n<li>list three</li>\n</ul></div><div></div>');
|
|
});
|
|
});
|