[openstreetmap/openstreetmap-website] Alternative autolinker (PR #7266)
Pablo Brasero
notifications at github.com
Fri Jul 24 14:51:22 UTC 2026
Fixes https://github.com/openstreetmap/openstreetmap-website/issues/7249
This is purely experimental and for discussion, hence marked as draft.
Do we need Rinku any more? I just tried out the "official" Rails autolinker, https://github.com/tenderlove/rails_autolink. What I saw:
- At least for `test/lib/rich_text_test.rb`, it runs exactly as fast as Rinku. See the makeshift benchmarking code in the last commit.
- It does the right thing in at least the edge case mentioned in the issue description.
I use quotes around "official" because it was removed from Rails and made an external gem [back in 2011](https://github.com/rails/rails/commit/81cfbf4146d3c5a58054b64112b8ce196f2fc061), and the stated reason was (scroll to the bottom of the commit):
> Unfortunately this method is extremely difficult to secure correctly. Ensuring this method is bullet-proof takes a faster release cycle than we have for rails.
This is unlikely to be any different from Rinku, so I think it's probably not an issue.
Anyway, an option. To be benchmarked, tried with more edge cases, etc. Also code needs to be completed as I haven't replaced all instances of Rinku. Thoughts?
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/7266
-- Commit Summary --
* Example edge case
* Alternative autolinker with rails_autolink
* Simple benchmarking
-- File Changes --
M Gemfile (1)
M Gemfile.lock (17)
M lib/rich_text.rb (26)
M test/lib/rich_text_test.rb (19)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/7266.patch
https://github.com/openstreetmap/openstreetmap-website/pull/7266.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7266
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7266 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260724/8c85f13e/attachment-0001.htm>
More information about the rails-dev
mailing list