[openstreetmap/openstreetmap-website] Kramdown formatting on reports text (PR #3539)

Harry Wood notifications at github.com
Fri Apr 29 00:24:04 UTC 2022


Pass the text of reports ('details' field) through the RichText formatter to give us kramdown formatting support.

Users don't generally get to see their reports. Only a few admins ever see them displayed, but DWG folks working with reports have complained of a **"wall of text"** problem when looking at some longer reports. This solves it with basic paragraphs rendered from double-newlines. Other kramdown tricks area a bonus:

<img width="900" alt="before-after" src="https://user-images.githubusercontent.com/227525/165867251-d671ad4b-3910-4149-8c9b-8dc13970d433.png">

We don't need to do support of alternative HTML formatting as we did for legacy diary entries. I don't think we need any special treatment for old reports in the database. We can bung them all through the kramdown formatter and it will either make no difference or will improve the display. 
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/3539

-- Commit Summary --

  * Add test of individual issue view with report
  * Format report text with kramdown
  * Add kramdown info box with preview button

-- File Changes --

    M app/models/report.rb (4)
    M app/views/issues/_reports.html.erb (2)
    M app/views/reports/new.html.erb (2)
    M test/models/report_test.rb (5)
    M test/system/issues_test.rb (11)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/3539.patch
https://github.com/openstreetmap/openstreetmap-website/pull/3539.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/3539 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220428/b07c5112/attachment.htm>


More information about the rails-dev mailing list