[openstreetmap/openstreetmap-website] SpamScorer: normalise whitespace in comparable form (PR #6661)

Grant notifications at github.com
Tue Dec 30 18:01:04 UTC 2025


### Description
Collapse Unicode whitespace runs to a single space and trim in SpamScorer::RichText#to_comparable_form to improve SpammyPhrase matching across newlines/tabs.

### How has this been tested?
Suitable tests have been added. Will be run as part of CI.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * SpamScorer: normalise whitespace in comparable form

-- File Changes --

    M lib/spam_scorer/rich_text.rb (2)
    M test/lib/spam_scorer_test.rb (15)

-- Patch Links --

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

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

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


More information about the rails-dev mailing list