Modul:Citation/COinS: Unterschied zwischen den Versionen
K
makeCOinS( args ), params
K (issn, eissn beide in COinS) |
K (makeCOinS( args ), params) |
||
| Zeile 10: | Zeile 10: | ||
-- module import | -- module import | ||
local ci = require( 'Module:Citation/i18n' ) | |||
local cu = require( 'Module:Citation/utilities' ) | local cu = require( 'Module:Citation/utilities' ) | ||
function cc.prepareForCOinS( args ) | function cc.prepareForCOinS( args ) | ||
| Zeile 44: | Zeile 44: | ||
for key, value in pairs( args ) do | for key, value in pairs( args ) do | ||
if | if ci.params[ key ] then | ||
args[ key ] = mw.ustring.gsub( args[ key ], ' ', ' ' ) | args[ key ] = mw.ustring.gsub( args[ key ], ' ', ' ' ) | ||
args[ key ] = mw.ustring.gsub( args[ key ], '&%w+;', '' ) -- remove entities | args[ key ] = mw.ustring.gsub( args[ key ], '&%w+;', '' ) -- remove entities | ||
| Zeile 71: | Zeile 71: | ||
end | end | ||
function cc.makeCOinS( args | function cc.makeCOinS( args ) | ||
local rft = {}, key, value | local rft = {}, key, value | ||
| Zeile 136: | Zeile 136: | ||
if #rft > 2 then | if #rft > 2 then | ||
for key, value in pairs( params ) do | for key, value in pairs( ci.params ) do | ||
if cu.isSet( args[ key ] ) | if cu.isSet( args[ key ] ) then | ||
if value.COinS and value.COinS ~= 'rft.jtitle' and value.COinS ~= 'rft.title' then | if value.COinS and value.COinS ~= 'rft.jtitle' and value.COinS ~= 'rft.title' then | ||
insertCOinS( value.COinS, args[ key ] ) | insertCOinS( value.COinS, args[ key ] ) | ||