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?
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.
When I click on it it’s still https://www.captaincontrat.com/articles-financement-societe/etapes-convention-actionnaires?utm_source=pragmatic&utm_medium=referral&utm_content=link
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?
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?
&
%26
I think we actually fixed this @techAPJ?
Yes, this issue was fixed back in December 2017 via this commit… but we now have a much better and stable fix in place:
https://github.com/discourse/onebox/commit/7a1885c48800693d9d4abfa9c58d6d25fd19ca65