Oneboxes with anchors hide the anchor

When I write a onebox with an anchor — for example to a particular comment in a GitHub issue — the generated onebox has multiple links:

The diminutive top one (in gray; the github.com/discourse/discourse text) preserves the anchor but the obvious big blue link strips it. I get that without special support, the onebox is describing the page itself, but I wrote an anchor tag and I’d like most folks that click it to go to the anchor. Sure, when there’s just a handful of comments it’s not huge, but if you’re trying to link into the middle of a complicated issue the lost context is a bigger deal.

A secondary feature request would be to add special anchor support for GitHub comments as you’ve done for Wikipedia (note that the generated oneboxes in that old topic are confusing because Wikipedia’s page structure has since changed so it does still work):

3 Likes

@nbianca recently pushed various improvements to this, it’s now available on tests-passed. Lets us know how it works for you.

2 Likes

This topic was automatically closed after 2 days. New replies are no longer allowed.