Module:Citation/CS1/Utilities: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி en:Module:Citation/CS1/Utilities இலிருந்து திருத்தங்கள் இறக்குமதி செய்யப்பட்டன: மல்லிகைப் பேரின சிற்றினத்திற்காக இதனைப் பதிவிறக்குகிறேன்
+ function: has_accept_as_written()
வரிசை 43:
return false;
end
 
 
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
 
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
 
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
 
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
 
]]
 
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
 
local count;
 
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
 
 
 
"https://tamilar.wiki/w/Module:Citation/CS1/Utilities" இலிருந்து மீள்விக்கப்பட்டது