# Feature the related anchor in github URLs with only one line?

**URL:** https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927
**Category:** Feature
**Created:** [11 בספטמבר,‏ 2014,‏ 12:42pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927 "2014-09-11T12:42:20Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [11 בספטמבר,‏ 2014,‏ 12:42pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/1 "2014-09-11T12:42:20Z")

</div>

Continuing the discussion from [Support Wikipedia anchors in onebox](https://meta.discourse.org/t/support-wikipedia-anchors-in-onebox/19664/3):

> [@Support Wikipedia anchors in onebox](https://meta.discourse.org/t/support-wikipedia-anchors-in-onebox/19664/3):
>
> [Update wikipedia\_onebox.rb · lidlanca/onebox@3ccb2d7 · GitHub](https://github.com/lidlanca/onebox/commit/3ccb2d7fccbb1eab4108307fc4c20baa7c46a554)

Any chance we can get the same love for github anchors?

Continuing the discussion from [Should any email subjects from discourse not be tagged?](https://meta.discourse.org/t/should-any-email-subjects-from-discourse-not-be-tagged/19911):

> [@watchmanmonitor](#):
>
> [discourse/config/locales/server.en.yml at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/config/locales/server.en.yml#L1153-L1158)

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [11 בספטמבר,‏ 2014,‏ 12:44pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/2 "2014-09-11T12:44:20Z")

</div>

Oh interesting - it’s big block, centered on the correct line, there’s just no highlight, or line number, so it’s not clear what’s being pointed out.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [11 בספטמבר,‏ 2014,‏ 2:45pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/3 "2014-09-11T14:45:35Z")

</div>

If you select a start and end point the one box will be limited to those lines:

> <https://github.com/discourse/discourse/blob/main/app/models/badge.rb#L4-L5>

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11 בספטמבר,‏ 2014,‏ 2:48pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/4 "2014-09-11T14:48:09Z")

</div>

This already exists as pointed out above.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [11 בספטמבר,‏ 2014,‏ 3:03pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/5 "2014-09-11T15:03:33Z")

</div>

Edit my post above to include a range- no change, but perhaps due to the fact it’s quoted?

> <https://github.com/discourse/discourse/blob/main/config/locales/server.en.yml#L1153-L1154>

Hm, no, amidoingthisright?

EDITED - doing it right now.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11 בספטמבר,‏ 2014,‏ 3:09pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/6 "2014-09-11T15:09:54Z")

</div>

Look more closely at the URL David posted, the right hand side.

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [11 בספטמבר,‏ 2014,‏ 3:29pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/7 "2014-09-11T15:29:01Z")

</div>

Thanks for that.

Seems I can’t onebox just one line, but using a range like `L1153-L1154` works to get the point across.

Having to use \>1 line isn’t a problem, I just don’t know how a lay-person (end user posting in our forum) is going to know this exists.

I’ve updated this topic’s subject accordingly.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [11 בספטמבר,‏ 2014,‏ 3:42pm UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/8 "2014-09-11T15:42:02Z")

</div>

I thought you could do 1 line like so:

> <https://github.com/discourse/discourse/blob/main/app/models/badge.rb#L4-L4>

Guess not. :-/

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [4 בדצמבר,‏ 2025,‏ 11:32am UTC](https://meta.discourse.org/t/feature-the-related-anchor-in-github-urls-with-only-one-line/19927/9 "2025-12-04T11:32:24Z")

</div>


