wikimedia-gadgets / twinkle

The English Wikipedia twinkle javascript helper
http://en.wikipedia.org/wiki/Wikipedia:Twinkle
Other
135 stars 151 forks source link

tag: redirect: custom redirect template name missing from display text #1763

Open NovemLinguae opened 1 year ago

NovemLinguae commented 1 year ago

Inspired by LaundryPizza03 at https://en.wikipedia.org/wiki/Wikipedia_talk:Twinkle#Custom_redirect_tags_using_the_Twinkle_popup

If you add a custom redirect tag in Twinkle settings

image
  "customRedirectTagList": [
    {
      "value": "R from antonym",
      "label": "redirect from a semantic antonym of the target page title"
    }
  ],

The tag displays like the below screenshot. Which is a problem because it is missing {{R from antonym}}: at the front of the text, which makes it hard to search for.

image

Normal tags include the template name in front of it:

image

This appears to be a bug and should be fixed.

NovemLinguae commented 1 year ago

The fix is probably in friendlytag.js. You'll want to make line 235 look more like lines 226-228. May even be able to copy paste. Please test and make sure it works before submitting a PR. Info on how to test at https://github.com/wikimedia-gadgets/twinkle/blob/master/CONTRIBUTING.md#testing-your-code

image