۲۸٬۸۸۴
ویرایش
fa.wikipedia.org>Mojtabakd (اشکال مربوط به «جعبه اطلاعات تلویزیون» هم برطرف شد!) |
جز (۱ نسخه واردشده) |
||
(۳ نسخهٔ میانی ویرایش شده توسط ۳ کاربر نشان داده نشد) | |||
خط ۶: | خط ۶: | ||
local category_in_empty_row_pattern = '%[%[%s*[ر][د][ه]%s*:[^]]*]]' | local category_in_empty_row_pattern = '%[%[%s*[ر][د][ه]%s*:[^]]*]]' | ||
local has_rows = false | local has_rows = false | ||
local lists = { | |||
plainlist_t = { | |||
patterns = { | |||
'^plainlist$', | |||
'%splainlist$', | |||
'^plainlist%s', | |||
'%splainlist%s' | |||
}, | |||
found = false, | |||
styles = 'Plainlist/styles.css' | |||
}, | |||
hlist_t = { | |||
patterns = { | |||
'^hlist$', | |||
'%shlist$', | |||
'^hlist%s', | |||
'%shlist%s' | |||
}, | |||
found = false, | |||
styles = 'Hlist/styles.css' | |||
} | |||
} | |||
local function has_list_class(args_to_check) | |||
for _, list in pairs(lists) do | |||
if not list.found then | |||
for _, arg in pairs(args_to_check) do | |||
for _, pattern in ipairs(list.patterns) do | |||
if mw.ustring.find(arg or '', pattern) then | |||
list.found = true | |||
break | |||
end | |||
end | |||
if list.found then break end | |||
end | |||
end | |||
end | |||
end | |||
local function fixChildBoxes(sval, tt) | local function fixChildBoxes(sval, tt) | ||
خط ۲۵۰: | خط ۲۸۸: | ||
if imageArgs.data and | if imageArgs.data and | ||
imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then | imageArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then | ||
has_rows = true | has_rows = true | ||
has_list_class({ imageArgs.rowclass, imageArgs.class }) | |||
local row = root:tag('tr') | local row = root:tag('tr') | ||
row:addClass(imageArgs.rowclass) | row:addClass(imageArgs.rowclass) |