Edición de «Módulo:Citas»
Puedes deshacer la edición. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces publica los cambios para así efectuar la reversión.
Revisión actual | Tu texto | ||
Línea 274: | Línea 274: | ||
if not checkurl( URL ) then | if not checkurl( URL ) then | ||
error_str = seterror( 'bad_url', {}, false, " " ) .. error_str; | error_str = seterror( 'bad_url', {}, false, " " ) .. error_str; | ||
elseif | elseif mw.title.getCurrentTitle():inNamespaces(0, 100, 104) and | ||
not mw.title.getCurrentTitle().text:match(' | not mw.title.getCurrentTitle().text:match('Wikipedia') and | ||
URL:match('// | URL:match('//[%a%.%-]+%.wikipedia%.org') then | ||
error_str = seterror( 'bad_url_autorreferencia', {}, false, " " ) .. error_str; | error_str = seterror( 'bad_url_autorreferencia', {}, false, " " ) .. error_str; | ||
end | end | ||
Línea 367: | Línea 367: | ||
]] | ]] | ||
function pmid(id) | function pmid(id) | ||
local test_limit = | local test_limit = 36000000; -- update this value as PMIDs approach | ||
local handler = cfg.id_handlers['PMID']; | local handler = cfg.id_handlers['PMID']; | ||
local err_cat = ''; -- presume that PMID is valid | local err_cat = ''; -- presume that PMID is valid | ||
Línea 413: | Línea 413: | ||
]] | ]] | ||
function pmc(id, embargo) | function pmc(id, embargo) | ||
local test_limit = | local test_limit = 10000000; -- update this value as PMCs approach | ||
local handler = cfg.id_handlers['PMC']; | local handler = cfg.id_handlers['PMC']; | ||
local err_cat = ''; -- presume that PMC is valid | local err_cat = ''; -- presume that PMC is valid | ||
Línea 419: | Línea 419: | ||
local text; | local text; | ||
if id:match("[^%d]") then -- if PMC has anything but digits | if id:match("[^%d]") then -- if PMC has anything but digits | ||
err_cat = ' ' .. seterror( 'bad_pmc' ); -- set an error message | err_cat = ' ' .. seterror( 'bad_pmc' ); -- set an error message | ||
Línea 597: | Línea 594: | ||
while true do | while true do | ||
pattern = pages:match("%[([%w/:\.]+%s+)[%w%d].*%]"); -- pattern is the opening bracket, the url and following space(s): "[url " | |||
if nil == pattern then break; end -- no more urls | |||
if nil == | pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible | ||
pages = pages:gsub( | |||
end | end | ||
pages = pages:gsub("[%[%]]", ""); -- remove the brackets | pages = pages:gsub("[%[%]]", ""); -- remove the brackets | ||
Línea 1274: | Línea 1270: | ||
local Quote = A['Quote']; | local Quote = A['Quote']; | ||
local PostScript = A['PostScript']; | |||
local LayURL = A['LayURL']; | local LayURL = A['LayURL']; | ||
Línea 1836: | Línea 1831: | ||
if is_set(Title) then | if is_set(Title) then | ||
if not is_set(TitleLink) and is_set(URL) then | if not is_set(TitleLink) and is_set(URL) then | ||
Title = externallink( URL, Title | Title = externallink( URL, Title ) .. TransError .. Format | ||
URL = ""; | URL = ""; | ||
TieneURL = true; | TieneURL = true; | ||
Línea 2061: | Línea 2056: | ||
if is_set(URL) then | if is_set(URL) then | ||
URL = " " .. externallink( URL, nil, URLorigin | URL = " " .. externallink( URL, nil, URLorigin ); | ||
end | end | ||
Línea 2075: | Línea 2070: | ||
end | end | ||
if is_set(Quote | if is_set(Quote) then | ||
-- Eliminar comillas de Quote | -- Eliminar comillas de Quote | ||
if (Quote:sub(1,1) == '"' and Quote:sub(-1,-1) == '"') or | if (Quote:sub(1,1) == '"' and Quote:sub(-1,-1) == '"') or | ||
Línea 2086: | Línea 2081: | ||
Quote:sub(-1,-1) == '!' then | Quote:sub(-1,-1) == '!' then | ||
PostScript = "" | PostScript = "" | ||
end | |||
Quote = sepc .." " .. wrap( 'quoted-text', Quote ); | Quote = sepc .." " .. wrap( 'quoted-text', Quote ); | ||
end | end |