Taginfo template has problems

The taginfo template appears to be introducing incorrectly URL-encoded characters.

For example, on https://wiki.openstreetmap.org/wiki/Key:garden:style down near the bottom-right of the page is “Tools for this tag.” Each of the links within it have %253A instead of a colon, which displays as %3A if you hover over the link but isn’t handled as such by the computer. So you end up going to https://taginfo.openstreetmap.org/keys/garden%253Astyle.

What that template is attempting to do, why it’s trying to do so in the first place, and how to fix it are far beyond my comprehension.

The correct URL should be https://taginfo.openstreetmap.org/keys/garden%3Astyle.

It is trying to encode the colon character it as its numerical value. You can do this with any character: https://taginfo.openstreetmap.org/%6b%65%79%73/%67%61%72%64%65%6e%3a%73%74%79%6c%65.

It is mostly used for special characters like spaces and Unicode characters. However, the colon character is allowed in URLs so it would be possible to just use https://taginfo.openstreetmap.org/keys/garden:style.

The %252A is what you get when you encode the URL twice.

“:” → (encoding : as 2A) → “%2A” → (encoding % as 25) → “%252A”

Indeed. But what I don’t know is why somebody thought it necessary to do that or what they were hoping to achieve. Presumably that person was trying to do something and any simple fix may break something else. I decided it was better to leave it alone and bring it to the attention of others who may understand the thinking behind it.

I tried to fix it myself, but could not locate the relevant code. I reported it in the wiki now (https://wiki.openstreetmap.org/wiki/Template_talk:KeyDescription#Double_URL_encoding_in_Taginfo_links).

fixed.