In onebox, `&` become `&`

I’m using the Discourse Affiliate plugin to add some params to URL. When the URL is used in plain text or in a link, everything is ok. But when it’s transformed in onebox, the & become &

Do you know why?

So the URL will be valid?

This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text.

Whatever, it’s more readable if & are used instead of & I think…

Is it a Onebox bug ?

To me it isn’t a bug at all. The URL is being shown in the correct format.

1 Like

When I click on it it’s still in the browser (exemple here

That URL works for me.

The example “here” link however opens the Discourse app.

I have a feeling this topic is more about the app than oneboxed?

We can see & instead of & in the URL now…

Yes, it can be confusing. Maybe you’ve had coding experience where backslash escapes needed to be backslash escaped themselves?

This is similar. Because the ampersand that signals the beginning of an entity is an entity itself, it “doubles up”


Maybe you should URL encode the ampersands in a URL context?

&   :arrow_right:   %26


I think we actually fixed this @techAPJ?

1 Like

Yes, this issue was fixed back in December 2017 via this commit… but we now have a much better and stable fix in place: