[openstreetmap/openstreetmap-website] Add URL prettification for plain texts (PR #6518)

Marwin Hochfelsner notifications at github.com
Wed Nov 12 15:59:14 UTC 2025


@hlfan commented on this pull request.



> +      replacement: "way/\\k<id>"
+    - list: ["relation/(?<id>\\d+)", "relation (?<id>\\d{5,})", "r(?<id>\\d+)"]
+      replacement: "relation/\\k<id>"
+    - list: ["changeset/(?<id>\\d+)", "changeset (?<id>\\d{5,})", "cs ?(?<id>\\d{5,})"]
+      replacement: "changeset/\\k<id>"
+    - list: ["note/(?<id>\\d+)", "note (?<id>\\d{5,})"]
+      replacement: "note/\\k<id>"
+    - list: ["user/(?<username>[^\\s]+)", "@(?<username>[^\\s]+)"]
+      replacement: "user/\\k<username>"
+    - list: ["(?<key>[^\"?#<>/\\s]+)=\\*?"]
+      replacement: "wiki/Key:\\k<key>"
+      host: "wiki.openstreetmap.org"
+    - list: ["(?<key>[^\"?#<>/\\s]+)=(?<value>[^\"?#<>\\s]+)"]
+      replacement: "wiki/Tag:\\k<key>=\\k<value>"
+      host: "wiki.openstreetmap.org"
+  print:

I updated the PR description to describe the pipeline, but as an example, `way/123` first gets expanded to `https://www.openstreetmap.org/way/123`, which is then converted into a hyperlink by Rinku, and following that, the text inside the <a> is shortened back to `way/123`.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6518/review/3454181790 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251112/e423b207/attachment.htm>


More information about the rails-dev mailing list