67 251
contributi
mNessun oggetto della modifica |
mNessun oggetto della modifica |
||
(17 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 79: | Riga 79: | ||
Cell:node(List) | Cell:node(List) | ||
else | else | ||
Cell | if type(Field[1]) == "table" then | ||
:wikitext(Field[1]) | Cell | ||
:wikitext(Field[1][1]) | |||
else | |||
Cell | |||
:wikitext(Field[1]) | |||
end | |||
end | end | ||
end | end | ||
Riga 241: | Riga 246: | ||
end | end | ||
--Removes suffix | --Removes suffix year or number specification | ||
FullName = FullName:gsub("%s%(%d+%)", "") | |||
--Removes suffix registry number | |||
FullName = FullName:gsub("%s[^%s]+$", "") | FullName = FullName:gsub("%s[^%s]+$", "") | ||
Riga 285: | Riga 292: | ||
end | end | ||
-- Determine if property is Assignment | if string.find(ParaString, "%[%[") == nil then | ||
-- There is no wikilink, plain text | |||
LIPattern = "<li>(.-)</li>" | |||
else | |||
-- A wikilink is present, discard surrounding text | |||
LIPattern = "<li>.-%[%[(.-)%]%].-</li>" | |||
end | |||
-- Determine if property is Assignment, so process a string like: | |||
-- [[Timeline 2267|2267]] <i>[[USS Enterprise NCC-1701|USS Enterprise]]</i> | |||
if PropName == "Assegnazione" then | if PropName == "Assegnazione" then | ||
-- | -- then remove italic | ||
ParaString = string.gsub(ParaString, "<i>", "") | |||
ParaString = string.gsub(ParaString, "</i>", "") | |||
-- then remove Timeline | |||
ParaString = string.gsub(ParaString, "(%[%[Timeline.-%]%])", "") | |||
end | end | ||
--Process UL or OL | --Process UL or OL | ||
for Item in string.gmatch(ParaString, LIPattern) do | for Item in string.gmatch(ParaString, LIPattern) do | ||
Riga 345: | Riga 362: | ||
local Character | local Character | ||
local Performer | local Performer | ||
--Remove italic | |||
FullRow = string.gsub(FullRow, "<i>", "") | |||
FullRow = string.gsub(FullRow, "</i>", "") | |||
--print (FullRow) | --print (FullRow) | ||
local CountLiks = select(2, string.gsub(FullRow, "%[%[", "")) | local CountLiks = select(2, string.gsub(FullRow, "%[%[", "")) | ||
Riga 391: | Riga 412: | ||
-- @param frame The interface to the parameters passed to {{#invoke:}} | -- @param frame The interface to the parameters passed to {{#invoke:}} | ||
-- @return Processed string | -- @return Processed string | ||
function p. | function p.SVGValidate(frame) | ||
local ValidateURI = "http://validator.w3.org/check?uri=" | local ValidateURI = "http://validator.w3.org/check?uri=" | ||
local FileTitle | local FileTitle | ||
Riga 401: | Riga 422: | ||
MediaURI = frame:callParserFunction('filepath:' .. string.sub(FileTitle.fullText, 6)) | MediaURI = frame:callParserFunction('filepath:' .. string.sub(FileTitle.fullText, 6)) | ||
--return FileTitle.fullText .. "<br />" .. FileTitle:fullUrl() .. "<br />" .. FileTitle:localUrl() .. "<br />" .. FileTitle:canonicalUrl() .. "<br />" .. MediaURI | --return FileTitle.fullText .. "<br />" .. FileTitle:fullUrl() .. "<br />" .. FileTitle:localUrl() .. "<br />" .. FileTitle:canonicalUrl() .. "<br />" .. MediaURI | ||
return "== Validazione ==" .. | return "\n== Validazione ==\n" .. "[[File:Valid SVG 1.1.svg|88px|link=" .. ValidateURI .. mw.uri.encode(MediaURI, "PATH") .. "]]" | ||
else | else | ||
return nil | return nil |