67 741
contributi
mNessun oggetto della modifica |
mNessun oggetto della modifica |
||
Riga 235: | Riga 235: | ||
-- | -- | ||
-- @param frame The interface to the parameters passed to {{#invoke:}} | -- @param frame The interface to the parameters passed to {{#invoke:}} | ||
-- @return Sanitized string representing one or more property values | -- No return @return Sanitized string representing one or more property values | ||
function p.ParameterToSemantic(frame) | function p.ParameterToSemantic(frame) | ||
local Separator = ";" | local Separator = ";" | ||
Riga 241: | Riga 241: | ||
local ParaString | local ParaString | ||
local FinalArray = {} | local FinalArray = {} | ||
local PropName | |||
local PropValue | |||
if frame.args[1] == nil then | if frame.args[1] == nil then | ||
PropName = "Error" | |||
else | else | ||
ParaString = frame.args[ | PropName = frame.args[1] | ||
if frame.args[2] == nil then | |||
PropValue = "Error" | |||
else | |||
ParaString = frame.args[2] | |||
if string.find(ParaString, "<li>") ~= nil then | |||
--Process UL or OL | |||
for Item in string.gmatch(ParaString, "<li>(.-)</li>") do | |||
table.insert(FinalArray, Item) | |||
end | |||
PropValue = table.concat(FinalArray, Separator) .. SepDeclaration | |||
else | |||
--No process, assign original value | |||
PropValue = ParaString | |||
end | |||
end | |||
end | end | ||
mw.smw.set(PropValue .. " = " .. PropValue) | |||
end | end | ||
function p.ParameterToSemanticTest(frame) | function p.ParameterToSemanticTest(frame) |