<p></p>
<p><b>@tomhughes</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r2037725747">app/views/diary_entries/_diary_entry.html.erb</a>:</p>
<pre style='color:#555'>> @@ -2,7 +2,10 @@
<%= render :partial => "diary_entry_heading", :object => diary_entry, :as => "diary_entry" %>
<div class="richtext text-break" xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
- <%= diary_entry.body.to_html %>
+ <%= truncated ? diary_entry.body.to_html(2000) : diary_entry.body.to_html %>
+ <% if truncated && diary_entry.body.was_truncated?(2000) %>
</pre>
<p dir="auto">This whole business of having the rich text object cache which lengths it has done truncations on is a pretty horrible interface.</p>
<p dir="auto">Really <code class="notranslate">to_html</code> should indicate directly if it's done a truncation though it would probably be quite painful - it seems like one option would be to have it return a pair of values (the HTML and a truncation flag) and the other would be for it to return a single object with <code class="notranslate">html</code> and <code class="notranslate">truncated?</code> methods.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5121#pullrequestreview-2757349962">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLI5TNGG45AO56NBDIT2Y2HHDAVCNFSM6AAAAABNFQLUA6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDONJXGM2DSOJWGI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNLRVGJSZZJQ4KXGT32Y2HHDA5CNFSM6AAAAABNFQLUA6WGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVELHJEU.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5121/review/2757349962</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5121#pullrequestreview-2757349962",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5121#pullrequestreview-2757349962",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>