模块:Citation/CS1:修订间差异
imported>LuaLuaLua 小无编辑摘要 |
imported>Yangfl |
||
| 第1行: | 第1行: | ||
local z = { | |||
error_categories = {}; | error_categories = {}; | ||
error_ids = {}; | error_ids = {}; | ||
| 第113行: | 第113行: | ||
-- Checks that parameter name is valid using the whitelist | -- Checks that parameter name is valid using the whitelist | ||
function validate( name ) | function validate( name ) | ||
name=tostring | name = tostring( name ); | ||
-- Normal arguments | -- Normal arguments | ||
| 第121行: | 第121行: | ||
-- Arguments with numbers in them | -- Arguments with numbers in them | ||
name=name | name = name:gsub( "%d+", "#" ); | ||
if whitelist.numbered_arguments[ name ] then | if whitelist.numbered_arguments[ name ] then | ||
return true; | return true; | ||
| 第251行: | 第251行: | ||
if ( code == "A" ) then | if ( code == "A" ) then | ||
return externallinkid({link=handler.link, label=handler.label, | return externallinkid({link=handler.link, label=handler.label, | ||
prefix="/authors/OL",id=id, separator=handler.separator, | prefix="http://openlibrary.org/authors/OL",id=id, separator=handler.separator, | ||
encode = handler.encode}) | encode = handler.encode}) | ||
elseif ( code == "M" ) then | elseif ( code == "M" ) then | ||
return externallinkid({link=handler.link, label=handler.label, | return externallinkid({link=handler.link, label=handler.label, | ||
prefix="/books/OL",id=id, separator=handler.separator, | prefix="http://openlibrary.org/books/OL",id=id, separator=handler.separator, | ||
encode = handler.encode}) | encode = handler.encode}) | ||
elseif ( code == "W" ) then | elseif ( code == "W" ) then | ||
return externallinkid({link=handler.link, label=handler.label, | return externallinkid({link=handler.link, label=handler.label, | ||
prefix="/works/OL",id=id, separator=handler.separator, | prefix= "http://openlibrary.org/works/OL",id=id, separator=handler.separator, | ||
encode = handler.encode}) | encode = handler.encode}) | ||
else | else | ||
return externallinkid({link=handler.link, label=handler.label, | return externallinkid({link=handler.link, label=handler.label, | ||
prefix="/OL",id=id, separator=handler.separator, | prefix= "http://openlibrary.org/OL",id=id, separator=handler.separator, | ||
encode = handler.encode}) .. | encode = handler.encode}) .. | ||
' ' .. seterror( 'bad_ol' ); | ' ' .. seterror( 'bad_ol' ); | ||
| 第862行: | 第862行: | ||
if PublicationPlace == Place then Place = ''; end | if PublicationPlace == Place then Place = ''; end | ||
local | local PublisherName = A['PublisherName']; | ||
local SubscriptionRequired = A['SubscriptionRequired']; | local SubscriptionRequired = A['SubscriptionRequired']; | ||
local Via = A['Via']; | local Via = A['Via']; | ||
| 第912行: | 第912行: | ||
if good1 and good2 and tonumber( result1 ) < tonumber( result2 ) then | if good1 and good2 and tonumber( result1 ) < tonumber( result2 ) then | ||
URL ="/pmc/articles/PMC" .. ID_list['PMC']; | URL = "http://www.ncbi.nlm.nih.gov/pmc/articles/PMC" .. ID_list['PMC']; | ||
URLorigin = cfg.id_handlers['PMC'].parameters[1]; | URLorigin = cfg.id_handlers['PMC'].parameters[1]; | ||
end | end | ||
else | else | ||
URL ="/pmc/articles/PMC" .. ID_list['PMC']; | URL = "http://www.ncbi.nlm.nih.gov/pmc/articles/PMC" .. ID_list['PMC']; | ||
URLorigin = cfg.id_handlers['PMC'].parameters[1]; | URLorigin = cfg.id_handlers['PMC'].parameters[1]; | ||
end | end | ||
| 第1,687行: | 第1,687行: | ||
return z | return z | ||