Module:Cite Q: Difference between revisions
Richardpruen (talk | contribs) m 1 revision imported |
use require('strict') instead of require('Module:No globals') |
||
Line 3: | Line 3: | ||
local p = {} | local p = {} | ||
require(' | require('strict') | ||
local wdib = require('Module:WikidataIB') | local wdib = require('Module:WikidataIB') | ||
local getValue = wdib._getValue | local getValue = wdib._getValue | ||
Line 479: | Line 479: | ||
if url then | if url then | ||
citeq_args.url = mw.text.split( url, " (", true )[1] | citeq_args.url = mw.text.split( url, " (", true )[1] | ||
local arcurl = mw.ustring.match( url, "%((.*)%)" ) | local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present | ||
if arcurl then | if arcurl then | ||
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)") | local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)") | ||
Line 618: | Line 618: | ||
end | end | ||
if author_count > 8 then -- convention in astronomy journals, optional mode for this? | if author_count > 8 then -- convention in astronomy journals, optional mode for this? | ||
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 | if 'all' == citeq_args['display-authors'] then | ||
citeq_args['display-authors'] = nil; -- unset because no longer needed | |||
else | |||
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names | |||
end | |||
end | end | ||
Line 628: | Line 632: | ||
end | end | ||
if editor_count > 8 then -- convention in astronomy journals, optional mode for this? | if editor_count > 8 then -- convention in astronomy journals, optional mode for this? | ||
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 | if 'all' == citeq_args['display-editors'] then | ||
citeq_args['display-editors'] = nil; -- unset because no longer needed | |||
else | |||
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names | |||
end | |||
end | end | ||