Oneboxing URLs with two dashes

Ok, here’s a weird bug. When an URL contains --, the markdown converts it do –

For example, this URL:


If I explicitly insert a link, it works, even though it is rendered incorectly:

PS: Hm, linkifying seems to be disabled here on meta, but hopefully the second example makes things clear.

Having two dashes in the URL is quite unusual. Do you need to do that? Why doesn’t a single dash suffice?

Well, I do not know, but I do not control how the URL looks. :slight_smile: I’d say if it is a valid URL, Discourse should handle it correctly, no?


I do think it is a minor bug in linkify / prettify interaction, @Vitaly is this an edge case we should report?

@danekhollas a workaround is to do <> which bypasses all magic.


That works but also prevents oneboxing.

There is an edge case here where we should onebox


On a line by itself

<> though is already the escape hatch from inline onebox so this would give it double meaning, it is edge case on top of edge case. Tricky problem, not sure there is trivial solution here. prettify though should ideally apply after linkify not before it, we can fix that.

I guess… the escape from one boxing is also to add a space in front of the URL. I have run into other cases like this on BBS so it is a real problem. I had to use HTML entity escaping to get around it which is even worse.

Sorry, I mean for example: will become so the escape hatch is: <> if you need it or a raw link without inline onebox.

So that means we turn <> into

  1. opt-in to onebox by force
  2. opt-out of inline onebox by force

It kind of has a double meaning, since it is mega ninja territory I guess we can live with it.

I am ok to make this change I guess.

This also raises the question of how do we “force opt-in” an inline onebox which I guess mean punycode url for now.

I am only referring to full size one boxes

See Onebox all the links! - meta - Boing Boing BBS

1 Like