Make email_excerpt method take an optional post param (#7570)

The spoiler alert plugin replaces spoiler text found in email excerpts with posts URL, which means it needs to have a reference to the post it's processing.

This change makes `email_excerpt` accepts an optional post param, which calls `PrettyText.format_for_email` which then triggers the `reduce_cooked` event that the plugin subscribes to.
This commit is contained in:
Osama Sayegh
2019-05-20 11:04:23 +03:00
committed by Régis Hanol
parent 50e6ee55a9
commit 14bae6d52d
3 changed files with 4 additions and 4 deletions

View File

@@ -248,7 +248,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
<tbody>
<tr>
<td class="post-excerpt" style="color:#0a0a0a;font-size:14px;font-weight:normal;padding:16px;text-align:<%= rtl? ? 'right' : 'left' %>;width:100%;">
<%= email_excerpt(post.cooked) %>
<%= email_excerpt(post.cooked, post) %>
</td>
</tr>
</tbody>