Module:AbilityHints: Difference between revisions

Vergir (talk | contribs)
Render hint icons without the item link so the icon no longer triggers the native title and infobox-tooltip gadget; only the custom hint tooltip remains (with help from vergir-bot LLM)
Wrap hint icons in our own link to the item page (keeps click-through while icon still renders link-free) for tooltip testing (with help from vergir-bot LLM)
Line 47: Line 47:
     for _, def in ipairs(CONFIG) do
     for _, def in ipairs(CONFIG) do
         if member[def.list] and not (def.suppressed_by and member[def.suppressed_by]) then
         if member[def.list] and not (def.suppressed_by and member[def.suppressed_by]) then
            local url = tostring(mw.uri.localUrl(def.item))
             local img = icon_module._render(def.item, { size = '24px', ['icon-only'] = 'true', ['no-link'] = 'true' })
             local img = icon_module._render(def.item, { size = '24px', ['icon-only'] = 'true', ['no-link'] = 'true' })
             table.insert(icons,
             table.insert(icons,
                 '<span class="ability-hint">' .. img
                 '<a class="ability-hint" href="' .. url .. '">' .. img
                 .. '<span class="ability-hint-tip">' .. def.tip .. '</span></span>'
                 .. '<span class="ability-hint-tip">' .. def.tip .. '</span></a>'
             )
             )
         end
         end