Jump to content

Module:Citation/CS1: Difference between revisions

Faster that gsub chains
m>Dragons flight
m (Protected Module:Citation/CS1: Highly visible template: Going to be semi-visible soon during preliminary citation tests ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)))
m>Dragons flight
(Faster that gsub chains)
Line 78: Line 78:


function safeforurl( str )
function safeforurl( str )
     return str:gsub('%[','['):gsub('%]',']'):gsub("\n", " ");
     return str:gsub( '[%[%]\n]', {   
            ['['] = '[',
            [']'] = ']',
            ['\n'] = ' ' } );
end
end


Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.