Module:CiteConversionTest
Appearance
c = {}
function c.test( frame )
local target = frame.args[1] or frame.args.target;
local tt = mw.title.new( target );
local content = tt:getContent();
local result = '';
local template;
local i = 1;
for template in string.gmatch( content, '%b[]' ) do
local f;
f = string.match( template, '%[%[%s*File:[^%]]*%]%]' );
if mode ~= nil and mode ~= 'quick' then
result = result .. '\n' .. f;
i = i + 1;
end
mode, param = string.match( template, '{{%s*cite quick%s*|%s*(%w*)%s*|([^}]*)}}' );
if mode ~= nil then
result = result .. '\n{{cite compare|mode=' .. mode .. " | " .. param .. "}}\n";
i = i + 1;
end
if i > 90 then break; end --prevent time outs
end
return frame:preprocess(result);
end
return c;