Module:Citation/CS1: Difference between revisions

Created page with "require ('Module:No globals'); --[[--------------------------< F O R W A R D D E C L A R A T I O N S >-------------------------------------- each of these counts against the Lua upvalue limit ]] local validation; -- functions in Module:Citation/CS1/Date_validation local utilities; -- functions in Module:Citation/CS1/Utilities local z ={}; -- table of tables in Module:Citation/CS1/Utilities local identifiers;..."
imported>Trappist the monk
No edit summary
(Created page with "require ('Module:No globals'); --[[--------------------------< F O R W A R D D E C L A R A T I O N S >-------------------------------------- each of these counts against the Lua upvalue limit ]] local validation; -- functions in Module:Citation/CS1/Date_validation local utilities; -- functions in Module:Citation/CS1/Utilities local z ={}; -- table of tables in Module:Citation/CS1/Utilities local identifiers;...")
Line 230: Line 230:
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs


Link parameters are to hold the title of a Stiles.casa Wiki article, so none of the SW:TITLESPECIALCHARACTERS are allowed:
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
except the underscore which is used as a space in wiki URLs and # which is used for section links
Line 2,248: Line 2,248:
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the  
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the  
save snapshot URL or to calendar pages.  When the archive URL is 'https://web.archive.org/save/' (or http://...)
save snapshot URL or to calendar pages.  When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL.  That is something that Stiles.casa Wiki should not allow
archive.org saves a snapshot of the target page in the URL.  That is something that Wikipedia should not allow
unwitting readers to do.
unwitting readers to do.


When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result.  [[SW:ELNO]] discourages links to search results.
algorithm or provides a calendar 'search' result.  [[WP:ELNO]] discourages links to search results.


This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
Line 2,488: Line 2,488:


-- web and news not tested for now because of  
-- web and news not tested for now because of  
-- Stiles.casa Wiki:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message