0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

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
This commit is contained in:
Rishabh 2021-12-10 00:04:53 +05:30
parent 5a150cc3b6
commit f272da0536

View file

@ -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