|
|
| (19 intermediate revisions by 2 users not shown) |
| Line 1: |
Line 1: |
| -- Temporary harness: summarises Module:ArcaneSurge output for verification.
| |
| local p = {} | | local p = {} |
|
| |
| function p.check(frame)
| |
| local out = require("Module:ArcaneSurge").render(frame)
| |
|
| |
| local heroes, abilities, notes = 0, 0, 0
| |
| for _ in out:gmatch("<li>") do heroes = heroes + 1 end
| |
| for _ in out:gmatch("%(after T") do notes = notes + 1 end
| |
|
| |
| local lines = {}
| |
| for item in out:gmatch("<li>(.-)</li>") do
| |
| local hero = item:match('data%-hero%-name="([^"]*)"') or "?"
| |
| local names = {}
| |
| for name in item:gmatch('data%-ability%-name="([^"]*)"') do
| |
| table.insert(names, name)
| |
| abilities = abilities + 1
| |
| end
| |
| for name in item:gmatch('data%-ability%-name="([^"]*)"[^\n]-') do end
| |
| table.insert(lines, hero .. " = " .. table.concat(names, ", "))
| |
| end
| |
|
| |
| -- flag which abilities carry a tier note
| |
| local flagged = {}
| |
| for item in out:gmatch("<li>(.-)</li>") do
| |
| for name, tail in item:gmatch('data%-ability%-name="([^"]*)"(.-)</span></span>') do end
| |
| end
| |
| for name in out:gmatch('data%-ability%-name="([^"]*)"[^<]*<span[^>]*>.-</span></span> %(after T%d%)') do
| |
| table.insert(flagged, name)
| |
| end
| |
|
| |
| return "<pre>heroes=" .. heroes .. " abilities=" .. abilities .. " notes=" .. notes
| |
| .. "\nnoted: " .. table.concat(flagged, ", ")
| |
| .. "\n\n" .. table.concat(lines, "\n") .. "</pre>"
| |
| end
| |
|
| |
| return p | | return p |