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:
parent
5a150cc3b6
commit
f272da0536
1 changed files with 3 additions and 1 deletions
|
@ -240,7 +240,9 @@ const serialize = async (postModel, options = {isBrowserPreview: false, apiVersi
|
||||||
post.excerpt = post.excerpt.replace(/\s\[http(.*?)\]/g, '');
|
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
|
// perform any email specific adjustments to the mobiledoc->HTML render output
|
||||||
// body wrapper is required so we can get proper top-level selections
|
// body wrapper is required so we can get proper top-level selections
|
||||||
|
|
Loading…
Add table
Reference in a new issue