<p dir="auto">After looking at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="49883145" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/844" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/844/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/844">#844</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2905009904" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5780" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5780/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5780">#5780</a> I think that first we can do something with full osm urls. Before trying to match patterns like <code class="notranslate">key=value</code> or <code class="notranslate">changeset 12345</code> or <code class="notranslate">n12345</code> we need to check them for false positives/negatives among existing comments. And the first to do with urls that makes sense is to shorten them like <a href="https://github.com/deevroman/better-osm-org">better-osm-org</a> does: replace <code class="notranslate">https://www.openstreetmap.org/</code> (and other osm domains) with <code class="notranslate">osm.org</code>. The only possible confusion here could be in comments like "When I tried opening <a href="https://www.osm.org/" rel="nofollow">https://www.osm.org/</a> ... but when I tried <a href="https://www.openstreetmap.org/" rel="nofollow">https://www.openstreetmap.org/</a> ..." that talk about different osm domains. Such comments are unlikely in plaintext changeset and note comments, and other editable texts support markdown syntax <code class="notranslate">[...](...)</code> where you can directly specify the visible text.</p>
<p dir="auto"><a href="https://github.com/user-attachments/assets/c63980d3-c916-425e-95ff-840c568b311b">image.png (view on web)</a></p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5844'>https://github.com/openstreetmap/openstreetmap-website/pull/5844</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/commits/d94a5a24b0907c610377a5a8d4abb8c877e67145" class="commit-link">d94a5a2</a>  Remove html-safe/unsafe branches from rich text linkify</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/commits/4aceca44f976f4c30ad074752b7f426703e64d5c" class="commit-link">4aceca4</a>  Split RichText text-to-html test</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/commits/cc06ce4c8fcc7cd686d1991c12bf3638247a6fae" class="commit-link">cc06ce4</a>  Shorten matching urls in linkify</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/files">3 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/files#diff-e769bbb8c1ba3711c5403b424ed9c218ffafba7f1890ee394717196f28ff4540">config/settings.yml</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/files#diff-6854f233485e4f1bf82ed21283e3637f9114d7c5431b80926ba2f5657b54e9fb">lib/rich_text.rb</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5844/files#diff-c1cefbd36a92f5d74850361751b9b01c7d326221cfa8c15c0c071008165de745">test/lib/rich_text_test.rb</a>
    (55)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5844.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5844.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5844.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5844.diff</a></li>
</ul>

<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/5844">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLKVDQOAO2YXPW7QM4L2WDGWDAVCNFSM6AAAAABZWQDNWOVHI2DSMVQWIX3LMV43ASLTON2WKOZSHE2DKMJUGQ4TSMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNLHUEEE33RWAML7SL2WDGWDA5CNFSM6AAAAABZWQDNWOWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHK7C2YUA.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/5844</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/5844",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5844",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>