Display trimmed down version of htmlBody and fix #1069

This commit is contained in:
Sung Won Cho 2015-07-15 15:52:01 +10:00
parent cb095e9663
commit b765982a9e
2 changed files with 7 additions and 6 deletions

View file

@ -39,8 +39,10 @@ buildCampaign = function (postsArray) {
date: moment(post.postedAt).format("MMMM D YYYY")
});
if (post.body)
properties.body = marked(Telescope.utils.trimWords(post.body, 20)).replace('<p>', '').replace('</p>', ''); // remove p tags
if (post.body) {
var bodyText = Telescope.utils.stripHTML(post.htmlBody);
properties.body = Telescope.utils.trimWords(bodyText, 20).replace('<p>', '').replace('</p>', ''); // remove p tags
}
if(post.url)
properties.domain = Telescope.utils.getDomain(post.url);

View file

@ -12,9 +12,9 @@
<div class="post-meta">
{{#if domain}}
<a class="post-domain" href="">{{domain}}</a>
|
|
{{/if}}
<span class="post-submitted">
{{#if profileUrl}}
Submitted by <a href="{{profileUrl}}" class="comment-link" target="_blank">{{authorName}}</a>
@ -31,7 +31,7 @@
{{#if body}}
<div class="post-body-excerpt">
{{{htmlBody}}}
{{body}}
<a href="{{postPageLink}}" class="comment-link" target="_blank">Read more</a>
</div>
{{/if}}
@ -39,4 +39,3 @@
<br>
</div>