Diferencia entre revisiones de «Módulo:Citas»
m 1 revisión importada |
wikitves>Leoncastro Sin resumen de edición |
||
Línea 367: | Línea 367: | ||
]] | ]] | ||
function pmid(id) | function pmid(id) | ||
local test_limit = | local test_limit = 45000000; -- 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 = 12000000; -- 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("^PMC%d") then | |||
id = id:sub(4, j) -- remove 'PMC' preffix if given | |||
end | |||
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 594: | Línea 597: | ||
while true do | while true do | ||
pattern = pages:match("%[( | 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 == pattern then break; end -- no more urls | ||
pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible | pages = pages:gsub(pattern, ""); -- remove as many instances of pattern as possible | ||
Línea 2095: | Línea 2098: | ||
PostScript = "" | PostScript = "" | ||
end | end | ||
if TransQuote and TransQuote ~= '' then | |||
Quote = Quote .. " " .. wrap( 'trans-quoted-title', TransQuote ); | Quote = Quote .. " " .. wrap( 'trans-quoted-title', TransQuote ); | ||
TransQuote = wrap( 'trans-quoted-title', TransQuote ); | TransQuote = wrap( 'trans-quoted-title', TransQuote ); | ||
end | |||
Quote = sepc .." " .. wrap( 'quoted-text', Quote ); | Quote = sepc .." " .. wrap( 'quoted-text', Quote ); | ||
end | end |