From fb973dbbf212558798f50d1e4ed0286f99c8b27d Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 1 Feb 2018 16:26:56 +0100 Subject: [PATCH] Fixed missing export of `card-markdown` card and broken tests no issue - fixes rendering bug introduced in https://github.com/TryGhost/Ghost/commit/0833b2855761f6d990de6bf0d883f78b4f25dd30 - updates test generators/fixtures to use new card names --- core/server/lib/mobiledoc/cards/card-markdown.js | 2 +- .../lib/mobiledoc/converters/mobiledoc-converter_spec.js | 8 ++++---- core/test/utils/fixtures/data-generator.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/server/lib/mobiledoc/cards/card-markdown.js b/core/server/lib/mobiledoc/cards/card-markdown.js index 10643b9d32..5de4d00feb 100644 --- a/core/server/lib/mobiledoc/cards/card-markdown.js +++ b/core/server/lib/mobiledoc/cards/card-markdown.js @@ -4,4 +4,4 @@ // our markdown-only editor was using the `card-markdown` card name const markdownCard = require('./markdown'); -module.exports = Object.assign(markdownCard, {name: 'card-markdown'}); +module.exports = Object.assign({}, markdownCard, {name: 'card-markdown'}); diff --git a/core/test/unit/lib/mobiledoc/converters/mobiledoc-converter_spec.js b/core/test/unit/lib/mobiledoc/converters/mobiledoc-converter_spec.js index 143658eb81..bf16c85da5 100644 --- a/core/test/unit/lib/mobiledoc/converters/mobiledoc-converter_spec.js +++ b/core/test/unit/lib/mobiledoc/converters/mobiledoc-converter_spec.js @@ -6,16 +6,16 @@ describe('Convert mobiledoc to HTML ', function () { version: '0.3.1', atoms: [], cards: [ - ['card-markdown', + ['markdown', { pos: 'top', - card_name: 'card-markdown', + card_name: 'markdown', markdown: '#heading\n\n- list one\n- list two\n- list three' } ], - ['card-html', { + ['html', { pos: 'top', - card_name: 'card-html', + card_name: 'html', html: '

HTML CARD

' }] ], diff --git a/core/test/utils/fixtures/data-generator.js b/core/test/utils/fixtures/data-generator.js index 285be3b72c..8dad6ba818 100644 --- a/core/test/utils/fixtures/data-generator.js +++ b/core/test/utils/fixtures/data-generator.js @@ -11,8 +11,8 @@ DataGenerator.markdownToMobiledoc = function markdownToMobiledoc(content) { markups: [], atoms: [], cards: [ - ['card-markdown', { - cardName: 'card-markdown', + ['markdown', { + cardName: 'markdown', markdown: content || '' }] ],