Editing Module:Citation/CS1/COinS

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 33: Line 33:
 
end
 
end
 
return title .. script; -- return the concatenation
 
return title .. script; -- return the concatenation
end
 
 
 
--[[--------------------------< E S C A P E _ L U A _ M A G I C _ C H A R S >----------------------------------
 
 
Returns a string where all of lua's magic characters have been escaped. This is important because functions like
 
string.gsub() treat their pattern and replace strings as patterns, not literal strings.
 
]]
 
 
local function escape_lua_magic_chars (argument)
 
argument = argument:gsub("%%", "%%%%"); -- replace % with %%
 
argument = argument:gsub("([%^%$%(%)%.%[%]%*%+%-%?])", "%%%1"); -- replace all other lua magic pattern characters
 
return argument;
 
 
end
 
end
   
Please note that all contributions to Climate Change AI Wiki are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (see Climate Change AI Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: