WoW:ItemLink: Difference between revisions

No change in size ,  13 September 2008
Modified pattern for extracting itemString. Sporadically, GetContainerItemLink(bagID, slotID) returns a link with no text between brackets. The new pattern extracts the item string nevertheless.
m (catfix, Replaced: {{wowapitype}} → {{wowapitype}}<br>)
(Modified pattern for extracting itemString. Sporadically, GetContainerItemLink(bagID, slotID) returns a link with no text between brackets. The new pattern extracts the item string nevertheless.)
Line 25: Line 25:
You can extract the itemString from a given itemLink with the following pattern:
You can extract the itemString from a given itemLink with the following pattern:


  local found, _, itemString = string.find(itemLink, "^|c%x+|H(.+)|h%[.+%]")
  local found, _, itemString = string.find(itemLink, "^|c%x+|H(.+)|h%[.*%]")


Note: The format of the link is similar for enchant, spell and quest links, with merely the "itemstring" changing. See [[spellString]], [[enchantString]] and [[questString]]
Note: The format of the link is similar for enchant, spell and quest links, with merely the "itemstring" changing. See [[spellString]], [[enchantString]] and [[questString]]
Anonymous user