From f272da05365c8cd993ba66a0290878131811397b Mon Sep 17 00:00:00 2001 From: Rishabh Date: Fri, 10 Dec 2021 00:04:53 +0530 Subject: [PATCH] Added post url option for mobiledoc cards conversion to html refs https://github.com/TryGhost/Team/issues/1231 refs https://github.com/TryGhost/Team/issues/1230 refs https://github.com/TryGhost/Team/issues/1229 - passes post url to mobiledoc html renderer - allows using the post url in email templates for upload cards, linking the static card ui to post directly --- core/server/services/mega/post-email-serializer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/server/services/mega/post-email-serializer.js b/core/server/services/mega/post-email-serializer.js index 4c25607b60..6e9b775c63 100644 --- a/core/server/services/mega/post-email-serializer.js +++ b/core/server/services/mega/post-email-serializer.js @@ -240,7 +240,9 @@ const serialize = async (postModel, options = {isBrowserPreview: false, apiVersi post.excerpt = post.excerpt.replace(/\s\[http(.*?)\]/g, ''); } - post.html = mobiledocLib.mobiledocHtmlRenderer.render(JSON.parse(post.mobiledoc), {target: 'email'}); + post.html = mobiledocLib.mobiledocHtmlRenderer.render( + JSON.parse(post.mobiledoc), {target: 'email', postUrl: post.url} + ); // perform any email specific adjustments to the mobiledoc->HTML render output // body wrapper is required so we can get proper top-level selections