יחידה:ParamValidator: הבדלים בין גרסאות בדף

DK
אכא"כ
שורה 113: שורה 113:
end
end
,  
,  
extract_options = function ( frame, optionsPrefix )
extract_options = function( frame, optionsPrefix )
optionsPrefix = optionsPrefix or 'options'  
optionsPrefix = optionsPrefix or 'options'  
שורה 272: שורה 272:


-- wraps report in hidden frame
-- wraps report in hidden frame
function wrapReport(report, template_name, options)
local function wrapReport(report, template_name, options)
if util.empty( report ) then return '' end
if util.empty( report ) then return '' end
local naked = mw.title.new( template_name )['text']  
local naked = mw.title.new( template_name )['text']  
שורה 287: שורה 287:


-- this is the "user" version, called with {{#invoke:}} returns a string, as defined by the options parameter
-- this is the "user" version, called with {{#invoke:}} returns a string, as defined by the options parameter
function validateParams( frame )
local function validateParams( frame )
-- for purple pages:
-- for purple pages:
שורה 301: שורה 301:


local replace_macros = function( s, param_names )
local replace_macros = function( s, param_names )
function concat_and_escape( t )  
local function concat_and_escape( t )  
local s = table.concat( t, ', ' )
local s = table.concat( t, ', ' )
return ( mw.ustring.gsub( s, '%%', '%%%%' ) )
return ( mw.ustring.gsub( s, '%%', '%%%%' ) )