In onebox, `&` become `&`

(Camille Roux) #1

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?

(Mittineague) #2

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.

(Camille Roux) #3

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

Is it a Onebox bug ?

(Mittineague) #4

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

(Camille Roux) #5

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

(Mittineague) #6

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?

(Camille Roux) #7

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

(Mittineague) #8

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”

(Eli the Bearded) #9

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

&   :arrow_right:   %26