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

Continuing the discussion from Support Wikipedia anchors in onebox:

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

Continuing the discussion from Should any email subjects from discourse not be tagged?:

1 Like

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.

1 Like

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

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

2 Likes

This already exists as pointed out above.

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/master/config/locales/server.en.yml#L1153-L1154

Hm, no, amidoingthisright?

EDITED - doing it right now.

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

1 Like

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.

I thought you could do 1 line like so:

https://github.com/discourse/discourse/blob/master/app/models/badge.rb#L4-L4

Guess not. :-/

2 Likes