Content deleted Content added
optional list1class |
undo |
||
Line 54:
local regex = orphanCat:gsub('([%[%]])', '%%%1')
return (wikitext:gsub(regex, ''):gsub(REGEX_MARKER, changer)) -- () omits gsub count
end
local function colorlinks(v, s)
if v and v ~= '' and s and s ~= '' then
if not mw.ustring.match(v, '<span style') then
v = mw.ustring.gsub(v, '%[%[([^%[%]|]*)%]%]',
'[[%1|<span style="' .. s .. '>%1</span>]]')
v = mw.ustring.gsub(v, '%[%[([^%[%]|]*)|([^%[%]|]*)%]%]',
'[[%1|<span style="' .. s .. '>%2</span>]]')
end
end
return v
end
local function extractstyle(v1, v2, v3)
local r = ''
local v = (v1 or '') .. ';' .. (v2 or '') .. ';' .. (v3 or '')
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(v, '&#[Xx]23;', '#'), '#', '#'), ';')
for k = 1,#slist do
local s = slist[k]
if s:match('^[%s]*background') or s:match('^[%s]*color') then
r = r .. s .. ';'
end
end
return r
end
Line 85 ⟶ 110:
args.name,
mini = 1,
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;
})
end
Line 132 ⟶ 157:
renderNavBar(titleCell)
if (args.stylelinks or '') == 'yes' then
args.title = colorlinks(args.title,
extractstyle(args.basestyle, args.titlestyle, ''))
end
titleCell
:tag('div')
Line 156 ⟶ 186:
if not args.above then return end
if (args.stylelinks or '') == 'yes' then
args.above = colorlinks(args.above,
extractstyle(args.basestyle, args.abovestyle, ''))
end
tbl:tag('tr')
:tag('td')
Line 172 ⟶ 207:
if not args.below then return end
if (args.stylelinks or '') == 'yes' then
args.below = colorlinks(args.below,
extractstyle(args.basestyle, args.belowstyle, ''))
end
tbl:tag('tr')
:tag('td')
Line 209 ⟶ 249:
groupCell
:attr('id', mw.uri.anchorEncode(args.group1))
end
if (args.stylelinks or '') == 'yes' then
args['group' .. listnum] = colorlinks(args['group' .. listnum],
extractstyle(args.basestyle, args.groupstyle, args['group' .. listnum .. 'style']))
end
Line 216 ⟶ 261:
:addClass(args.groupclass)
:cssText(args.basestyle)
groupCell
Line 441 ⟶ 486:
renderTrackingCategories(res)
end
return striped(tostring(res))
end
|