Module:Citation/CS1: Difference between revisions
convert hyphens to dashs
m>Dragons flight (kill duplication) |
m>Dragons flight (convert hyphens to dashs) |
||
Line 79: | Line 79: | ||
function safeforurl( str ) | function safeforurl( str ) | ||
return str:gsub('%[','['):gsub('%]',']'):gsub("\n", " "); | return str:gsub('%[','['):gsub('%]',']'):gsub("\n", " "); | ||
end | |||
function hyphentodash( str ) | |||
return str:gsub( '-', '–' ); | |||
end | end | ||
Line 346: | Line 350: | ||
local Position = nil | local Position = nil | ||
local Page | local Page | ||
local Pages = args.pages | local Pages = hyphentodash( args.pages ) | ||
if Pages == nil or Pages == '' then | if Pages == nil or Pages == '' then | ||
Page = args.page -- allows Pages to override Page | Page = args.page -- allows Pages to override Page | ||
Line 372: | Line 376: | ||
local DoiBroken = args.doi_inactivedate or args.doi_brokendate or args.DoiBroken | local DoiBroken = args.doi_inactivedate or args.doi_brokendate or args.DoiBroken | ||
local ID = args.id or args.ID | local ID = args.id or args.ID | ||
local ISBN = args.isbn13 or args.isbn or args.ISBN | local ISBN = hyphentodash( args.isbn13 or args.isbn or args.ISBN ) | ||
local ISSN = args.issn or args.ISSN | local ISSN = args.issn or args.ISSN | ||
local JFM = args.jfm or args.JFM | local JFM = args.jfm or args.JFM |