<p></p>
<p><b>@AntonKhorev</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1836505783">app/views/diary_entries/_diary_entry.html.erb</a>:</p>
<pre style='color:#555'>> @@ -2,7 +2,7 @@
<%= 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.truncated_body(1000).to_html : diary_entry.body.to_html %>
</pre>
<p dir="auto">First markdown from the RichText object is converted to html. Then html is processed by <code class="notranslate">truncated_body</code> and a new RichText object is constructed. Then html is again extracted from that object. And if the html is nontrivial it may get mangled in the process, turning, for example, this</p>
<pre class="notranslate"><code class="notranslate">There's a table below:
| thing | 42 | an important thing |
| thing | 43 | an important thing |
</code></pre>
<p dir="auto"><a href="https://github.com/user-attachments/assets/06149a10-3199-4881-bf89-091ec8842dc6">image.png (view on web)</a></p>
<p dir="auto">into this</p>
<p dir="auto"><a href="https://github.com/user-attachments/assets/0661fb58-0bc4-414c-b850-476c6621873a">image.png (view on web)</a></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-2427014169">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMDLIVGMLWY2EXWVOD2ACGHDAVCNFSM6AAAAABNFQLUA6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDIMRXGAYTIMJWHE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLJUMRCNF6NCVRW2M5D2ACGHDA5CNFSM6AAAAABNFQLUA6WGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUQVFGBS.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/2427014169</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-2427014169",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5121#pullrequestreview-2427014169",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>