2 354
contributi
Nessun oggetto della modifica |
|||
Riga 26: | Riga 26: | ||
--[[ =============================================================================== | --[[ =============================================================================== | ||
Caricamente delle tabelle di configurazione del modulo. | |||
===============================================================================]] | ===============================================================================]] | ||
local cfg = mw.loadData('Module:Citazione/Configurazione') | local cfg = mw.loadData('Module:Citazione/Configurazione') | ||
Riga 413: | Riga 413: | ||
options.pattern = mw.ustring.gsub( options.pattern, '([^%[]%[[^%[]%S+)$1(.-%])', '%1$2%2' ); | options.pattern = mw.ustring.gsub( options.pattern, '([^%[]%[[^%[]%S+)$1(.-%])', '%1$2%2' ); | ||
end | end | ||
return mw.ustring.format( '[[%s|%s]]%s%s', | return mw.ustring.format( '[[wikipedia:it:%s|%s]]%s%s', | ||
options.link, options.label, options.separator or " ", | options.link, options.label, options.separator or " ", | ||
substitute( options.pattern, {mw.text.nowiki(options.id), url_string} ) | substitute( options.pattern, {mw.text.nowiki(options.id), url_string} ) | ||
Riga 1 182: | Riga 1 182: | ||
------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ||
local auto_Periodical = false | local auto_Periodical = false | ||
if in_array(config.CitationClass, {'web'}) and not is_set(Periodical) and is_set(URL) then | if in_array(config.CitationClass, {'web'}) and not is_set(Periodical) and not is_set(PublisherName) and is_set(URL) then | ||
Periodical = mw.ustring.match(URL, "//([^/#%?]*)") or '' | Periodical = mw.ustring.match(URL, "//([^/#%?]*)") or '' | ||
-- tolgo anche eventuale www. | -- tolgo anche eventuale www. | ||
Riga 1 191: | Riga 1 191: | ||
if Periodical and mw.ustring.lower(Title or '') == mw.ustring.lower(Periodical) then | if Periodical and mw.ustring.lower(Title or '') == mw.ustring.lower(Periodical) then | ||
Periodical = nil | Periodical = nil | ||
end | end | ||
auto_Periodical = true | auto_Periodical = true | ||
Riga 1 658: | Riga 1 655: | ||
Authors = wrap(msg_editors, Authors) | Authors = wrap(msg_editors, Authors) | ||
end | end | ||
elseif is_set(Contributors) and is_set(Title) then | |||
Authors, Editors = Contributors, Authors | |||
Authors, Editors = Contributors, | |||
end | end | ||
fragment_citation = Fragment.new({Authors, Chapter}, sepc) | fragment_citation = Fragment.new({Authors, Chapter}, sepc) | ||
if Chapter ~= "" or Editors ~= "" then | if Chapter ~= "" or Editors ~= "" then | ||
if A:ORIGIN('Periodical') == 'sito' or auto_Periodical then -- antepone "su" anzichè "in" per i siti web | |||
if A:ORIGIN('Periodical') == 'sito' or auto_Periodical then | |||
fragment_citation:last("su") | fragment_citation:last("su") | ||
else | else |
contributi