diff --git a/core/server/lib/mobiledoc/create-card.js b/core/server/lib/mobiledoc/create-card.js index 8049469b1c..44ba8d61f9 100644 --- a/core/server/lib/mobiledoc/create-card.js +++ b/core/server/lib/mobiledoc/create-card.js @@ -1,7 +1,7 @@ let urlUtils; module.exports = function createCard(card) { - const defaultTransformer = function (payload) { + const defaultTransformer = function (urlUtils, payload) { return payload; }; diff --git a/core/test/unit/lib/mobiledoc/cards/hr_spec.js b/core/test/unit/lib/mobiledoc/cards/hr_spec.js index 8d75301f6e..679b87b602 100644 --- a/core/test/unit/lib/mobiledoc/cards/hr_spec.js +++ b/core/test/unit/lib/mobiledoc/cards/hr_spec.js @@ -13,4 +13,16 @@ describe('HR card', function () { serializer.serialize(card.render(opts)).should.match('
'); }); + + it('transforms urls absolute to relative', function () { + let payload = {}; + const transformed = card.absoluteToRelative(payload, {}); + transformed.should.deepEqual({}); + }); + + it('transforms urls relative to absolute', function () { + let payload = {}; + const transformed = card.relativeToAbsolute(payload, {}); + transformed.should.deepEqual({}); + }); });