Zum Inhalt springen

Modul:Citation: Unterschied zwischen den Versionen

erweiterter Test doi, hdl
Keine Bearbeitungszusammenfassung
(erweiterter Test doi, hdl)
Zeile 175: Zeile 175:
end
end


if cu.isSet( args.ol ) and not args.ol:match('^OL%d+[AMW]$') then
if cu.isSet( args.ol ) and not args.ol:match( '^OL%d+[AMW]$' ) then
args.ol = ''
args.ol = ''
table.insert( wrong, 'ol' )
table.insert( wrong, 'ol' )
end
end


if cu.isSet( args.doi ) and not mw.ustring.match( args.doi, '^10%.[1-9]%d%d%d%d?/.+$' ) then
-- in suffix spaces or n-dashes and at the end periods or commas are not allowed
if cu.isSet( args.doi ) and not mw.ustring.match( args.doi, '^10%.[1-9]%d%d%d%d?/[^%s–]-[^%.,]$' ) then
args.doi = ''
args.doi = ''
table.insert( wrong, 'doi' )
table.insert( wrong, 'doi' )
end
if cu.isSet( args.hdl ) and not mw.ustring.match( args.hdl, '^[1-9][%d%.]+d%/[^%s–]-[^%.,]$' ) then
args.hdl = ''
table.insert( wrong, 'hdl' )
end
end


Zeile 200: Zeile 206:
if args.access == '' then
if args.access == '' then
cu.addErrorMsg( ci.texts.accesswrong )
cu.addErrorMsg( ci.texts.accesswrong )
elseif not cu.isSet( args.url ) and not cu.isSet( args.archiveUrl )
elseif not cu.isSet( args.url ) and not cu.isSet( args.archiveUrl ) and
and not cu.isSet( args.doi ) and not cu.isSet( args.jstor ) then
not cu.isSet( args.doi ) and not cu.isSet( args.hdl ) and
not cu.isSet( args.jstor ) then
cu.addErrorMsg( ci.texts.accessNoUrl )
cu.addErrorMsg( ci.texts.accessNoUrl )
end
end
Zeile 347: Zeile 354:
if cu.isSet( args.doi ) then
if cu.isSet( args.doi ) then
cu.insertItem2( tab, cu.encodeHandle( args.doi ), args.doi, ci.formatters.dbDoi )
cu.insertItem2( tab, cu.encodeHandle( args.doi ), args.doi, ci.formatters.dbDoi )
end
elseif cu.isSet( args.hdl ) then
if cu.isSet( args.hdl ) then
cu.insertItem2( tab, cu.encodeHandle( args.hdl ), args.hdl, ci.formatters.dbHdl )
cu.insertItem2( tab, cu.encodeHandle( args.hdl ), args.hdl, ci.formatters.dbHdl )
end
end
Anonymer Benutzer