#6010 added truncated diary entries to profile pages. The truncation procedure is different from from others already in use. It gets html, strips tags and does the standard rails truncation to 150 chars:
```ruby truncate(strip_tags(entry.body.to_html), :length => 150) ``` So it's truncate to plaintext. This is similar to richtext `.description` for `og:description` from #5056. I experimented using `entry.body.description` instead of `truncate(...)`. One thing that I wanted to change in `.description` is a truncation separator. This is what this PR does. Before:  After:  You can view, comment on, or merge this pull request online at: https://github.com/openstreetmap/openstreetmap-website/pull/6071 -- Commit Summary -- * Rename DESCRIPTION_MAX_LENGTH * Replace RichText consts with a shorter symbol in tests * Truncate rich text descriptions at word boundaries if not too short * Allow word separator to consist of multiple spaces -- File Changes -- M lib/rich_text.rb (13) M test/lib/rich_text_test.rb (42) -- Patch Links -- https://github.com/openstreetmap/openstreetmap-website/pull/6071.patch https://github.com/openstreetmap/openstreetmap-website/pull/6071.diff -- Reply to this email directly or view it on GitHub: https://github.com/openstreetmap/openstreetmap-website/pull/6071 You are receiving this because you are subscribed to this thread. Message ID: <openstreetmap/openstreetmap-website/pull/6...@github.com>
_______________________________________________ rails-dev mailing list rails-dev@openstreetmap.org https://lists.openstreetmap.org/listinfo/rails-dev