మాడ్యూల్:Citation/CS1/COinS: కూర్పుల మధ్య తేడాలు
Content deleted Content added
Arjunaraoc (చర్చ | రచనలు) చి en:Module:Citation/CS1/COinS నుండి కూర్పును దిగుమతి చేసాం: తెవికీలో తాజా |
sync from sandbox; |
||
పంక్తి 27:
script = strip_apostrophe_markup (script); -- strip any apostrophe markup
else
script = '';
end
if is_set (title) and is_set (script) then
పంక్తి 66:
end
pages = pages:gsub("[%[%]]", ""); -- remove the brackets
pages = pages:gsub("–", "-" ); -- replace endashes with hyphens
pages = pages:gsub("&%w+;", "-" ); -- and replace HTML entities (– etc.) with hyphens; do we need to replace numerical entities like   and the like?
return pages;
end
పంక్తి 137:
end
value = value:gsub (cfg.stripmarkers['math'], "MATH RENDER ERROR");
value = mw.text.unstripNoWiki (value); -- replace nowiki stripmarkers with their content
పంక్తి 144:
value = value:gsub ('\226\128\138', ' '); -- replace hair space with plain space
if not mw.ustring.find (value, cfg.indic_script) then -- don't remove zero-width joiner characters from indic script
value = value:gsub ('‍', '');
value = mw.ustring.gsub (value, '[\226\128\141\226\128\139\194\173]', ''); -- remove zero-width joiner, zero-width space, soft hyphen
end
value = value:gsub ('[\009\010\013 ]+', ' ');
return value;
end
పంక్తి 241:
OCinSoutput["rft.date"] = data.Date; -- book, journal, dissertation
for k, v in pairs( data.ID_list ) do -- what to do about these? For now assume that they are common to all?
if k == 'ISBN' then v = v:gsub( "[^-0-9X]", "" ); end
Line 250 ⟶ 248:
elseif string.sub (id or "", 1, 3 ) == 'rft' then -- for isbn, issn, eissn, etc. that have defined COinS keywords
OCinSoutput[ id ] = v;
elseif 'url' == id then
OCinSoutput["rft_id"] = table.concat ({data.ID_list[k], "#id-name=", cfg.id_handlers[k].label});
elseif id then -- when cfg.id_handlers[k].COinS is not nil so urls created here
OCinSoutput["rft_id"] = table.concat{ cfg.id_handlers[k].prefix, v, cfg.id_handlers[k].suffix or '', "#id-name=", cfg.id_handlers[k].label }; -- others; provide a URL and indicate identifier name as #fragment (human-readable, but transparent to browsers)
end
|