@AntonKhorev commented on this pull request.


> @@ -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 %>

First markdown from the RichText object is converted to html. Then html is 
processed by `truncated_body` 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

```
There's a table below:

| thing | 42 | an important thing |
| thing | 43 | an important thing |
```

![image](https://github.com/user-attachments/assets/06149a10-3199-4881-bf89-091ec8842dc6)

into this

![image](https://github.com/user-attachments/assets/0661fb58-0bc4-414c-b850-476c6621873a)


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5121#pullrequestreview-2427014169
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5121/review/2427014...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to