We've built up a nice repertoire of regression test cases from bugs we've had in the past, so I collected them here to help ensure that any fix to the autocard tool does not reintroduce an old bug.
- Regular cards (Lightning Bolt)
- Cards with apostrophes (Death's Shadow)
- Single word cards whose names are a subset of another card (Island, Curiousity)
- Double word cards whose names are a subset of another card (Sun Titan)
- Cards that are also an avatar (Platinum Angel)
- Both an apostrophe, and an avatar (Hell's Caretaker)
2018-03-09 Test Results*
Base URL is gatherer.wizards.com/Pages/Search/Default.aspx (replaced by ellipses below).
[mtg:Lightning Bolt]
-> ...?name=%2b%5bLightning%20Bolt%5d
[mtg:Death's Shadow]
-> ...?name=%2b%5bDeath%27s%5d%2b%5bShadow%5d
[mtg:Island]
-> ...?name=%2b%5bIsland%5d
[mtg:Sun Titan]
-> ...?name=%2b%5bSun%20Titan%5d
[mtg:Platinum Angel]
-> ...?name=%2b%5bPlatinum%20Angel%5d
[mtg:Hell's Caretaker]
-> ...?name=%2b%5bHell%27s%5d%2b%5bCaretaker%5d
I'm going to assume that fixing the autocard tool is not the highest priority item for the Stack Exchange developers, but that they might be persuaded to fix it if we provide the algorithm. So with some help from the folks in chat I took a stab at it, and found a solution that works:
https://jsfiddle.net/ws165r64/37/
All of the generated links go directly to the card in Chrome, Firefox, IE, and Opera.
*If you want to check my test results, be aware that the autocard generated URLs appear to be baked into the posts. For example, the Sun Titan bug was fixed in 2016, but old posts were not retroactively fixed. To see the current behavior, go to the site chat and type [mtg:cardname]
.