p =
function p.test(frame) local entityid, propertyid = frame.args.entityid, frame.args.propertyid local statementstbl = mw.wikibase.getBestStatements(entityid, propertyid) local t = for k, v in pairs(statementstbl) do local v = v.mainsnak.datavalue.value.id local sitelink = mw.wikibase.getSitelink(v) or "" local a = string.find(sitelink, "%(") or "" local b = string.match(sitelink, "(%w+) (%w+) (%w+) (%w+)") or "" if sitelink
"" then local sitelink = ""..mw.wikibase.getSitelink(v).."" local display_text = sitelink:gsub('%b', ) local statement = ""..display_text.."" tables = table.insert(t, statement) end if sitelink ~= "" and a
"" then local statement = ""..sitelink.."" tables = table.insert(t, statement) end end return table.concat(t, "
") end
return p