[openstreetmap/openstreetmap-website] Simpliy linkify normalisation to use a single array of rules (PR #5862)
Anton Khorev
notifications at github.com
Tue Apr 8 10:17:07 UTC 2025
@AntonKhorev commented on this pull request.
> -linkify_hosts: ["www.openstreetmap.org", "www.osm.org", "www.openstreetmap.com", "openstreetmap.org", "osm.org", "openstreetmap.com"]
-# Shorter host to replace main hosts
-linkify_hosts_replacement: "osm.org"
-# Wiki website hosts to match in linkify
-linkify_wiki_hosts: ["wiki.openstreetmap.org", "wiki.osm.org", "wiki.openstreetmap.com", "wiki.openstreetmaps.org", "osm.wiki", "www.osm.wiki", "wiki.osm.wiki"]
-# Shorter host to replace wiki hosts
-linkify_wiki_hosts_replacement: "osm.wiki"
-# Regexp for wiki prefix that can be removed
-linkify_wiki_optional_path_prefix: "^/wiki(?=/[A-Z])"
+# Normalisation rules for linkify
+linkify_rules:
+ - hosts: ["www.openstreetmap.org", "www.osm.org", "www.openstreetmap.com", "openstreetmap.org", "osm.org", "openstreetmap.com"]
+ host_replacement: "osm.org"
+ - hosts : ["wiki.openstreetmap.org", "wiki.osm.org", "wiki.openstreetmap.com", "wiki.openstreetmaps.org", "osm.wiki", "www.osm.wiki", "wiki.osm.wiki"]
+ host_replacement: "osm.wiki"
+ path_prefix: "^/wiki(?=/[A-Z])"
With this name you'll have to guess what this prefix means. The first guess will likely be that it has to match if any url transformation is to happen, and it's not the case.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5862#pullrequestreview-2749448211
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5862/review/2749448211 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250408/2d0f850a/attachment.htm>
More information about the rails-dev
mailing list