<p></p>
<p><b>@1ec5</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2091887989">app/models/social_link.rb</a>:</p>
<pre style='color:#555'>> +class SocialLink < ApplicationRecord
+ belongs_to :user
+
+ validates :url, :format => { :with => %r{\A(https?://.+|@([a-zA-Z0-9_]+)@([\w\-\.]+))\z}, :message => :http_parse_error }
+
+ URL_PATTERNS = {
+ :bluesky => %r{\Ahttps?://(?:www\.)?bsky\.app/profile/([a-zA-Z0-9\._-]+)},
+ :discord => %r{\Ahttps?://(?:www\.)?discord\.com/users/(\d+)},
+ :facebook => %r{\Ahttps?://(?:www\.)?facebook\.com/([a-zA-Z0-9.]+)},
+ :flickr => %r{\Ahttps?://(?:www\.)?flickr\.com/people/([a-zA-Z0-9@._-]+)},
+ :github => %r{\Ahttps?://(?:www\.)?github\.com/([a-zA-Z0-9_-]+)},
+ :gitlab => %r{\Ahttps?://(?:www\.)?gitlab\.com/([a-zA-Z0-9_-]+)},
+ :instagram => %r{\Ahttps?://(?:www\.)?instagram\.com/([a-zA-Z0-9._]+)},
+ :linkedin => %r{\Ahttps?://(?:www\.)?linkedin\.com/in/([a-zA-Z0-9_-]+)},
+ :line => %r{\Ahttps?://(?:www\.)?line\.me/ti/p/([a-zA-Z0-9_-]+)},
+ :mastodon => %r{\Ahttps?://(?:(?:www\.)?(mastodon\.social|en\.osm\.town))/([@a-zA-Z0-9_]+)},
</pre>
<p dir="auto">Yes, a leading <code class="notranslate">@</code> is required. Technically the <code class="notranslate">@</code> can still appear inside the handle in order to load a profile remotely from a different server, for example, <a href="https://mapstodon.space/@tomh@en.osm.town" rel="nofollow">https://mapstodon.space/@tomh@en.osm.town</a>. But I think it’s perfectly fine if we don’t handle that case, since the user should provide a direct URL anyways.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2091887989">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLN4MM7KAPJ456RHDCT26TYBBAVCNFSM6AAAAABUCYTSJCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQNBUHA3DCNZSG4">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLC2NQWJV5IUB6XXDT26TYBBA5CNFSM6AAAAABUCYTSJCWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTVJSESR6.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5439/review/2844861727</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2091887989",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5439#discussion_r2091887989",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>