@HolgerJeromin commented on this pull request.


> +    :bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)}
+  }.freeze
+
+  NO_USERNAME_PLATFORMS = %w[discord line skype slack].freeze
+
+  def parsed
+    URL_PATTERNS.each do |platform, pattern|
+      names = url.match(pattern)
+      if names
+        return {
+          :platform => platform.to_s,
+          :name => NO_USERNAME_PLATFORMS.include?(platform.to_s) ? 
platform.to_s.capitalize : names[1]
+        }
+      end
+    end
+    { :platform => nil, :name => url }

I always hate if browsers liying about the real url, but here this is probably 
a good idea.

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/5439/review/2628895...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to