[openstreetmap/openstreetmap-website] Provide a truncated view of recent diaries (PR #5121)
Anton Khorev
notifications at github.com
Sat Apr 5 13:02:43 UTC 2025
AntonKhorev left a comment (openstreetmap/openstreetmap-website#5121)
> @AntonKhorev Unfortunately, from what I've tested, we can't truncate after sanitize/linkify, because truncation changes HTML code and Ruby on Rails doesn't render it if it is not sanitized/linkified once more.
It's rendered if you add `html_safe`, like `sanitize` does:
```ruby
def to_truncated_html(truncation_length = nil)
truncate_html(to_html, truncation_length).to_s.html_safe
end
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5121#issuecomment-2780712144
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5121/c2780712144 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250405/44299db0/attachment.htm>
More information about the rails-dev
mailing list