User:Ucucha/HarvErrors
From Wikipedia, the free encyclopedia
This section in a nutshell: Effective April 2020, CS1 templates (e.g. {{cite book}}, {{cite journal}}, and the other {{cite ...}} templates) behave like CS2 templates (e.g. {{citation}}) with respects to the generation of harvard-style anchors (see discussion). This means that adding |ref=harv to "long" CS1 citations is no longer required to use "short" citation templates like {{harvnb}}, {{sfn}}, and other {{harv}}-like footnotes.
If you see more yellow warnings like
than usual, those are caused by User:Ucucha/HarvErrors.js. To suppress/reduce these yellow warnings, you can use any of the following options
If there still are errors after this, see how to deal with harvard-style citation issues. The documentation might be a bit out of date, but every piece of advice listed for CS2 (e.g. {{citation}}) now applies to CS1 (e.g. {{cite book}}) as well. If none of those options satisfy you, you can make a new script request at WP:SCRIPTREQ. |
Harvard citation templates like {{Sfn}} are prone to problems with their automatically generated links (see for an extreme example). User:Ucucha/HarvErrors.js (based on User:Svick/HarvErrors.js) checks these links for validity and displays an error message for incorrect links. In addition, it checks for citations that are set up to receive links, but do not have any pointing to them.
For example, the following code produces an incorrect link and a citation without anything pointing to it:
Text{{Sfn|Smith|2011|p=9}}
{{reflist}}
==References==
*{{cite book|last=Smith|first=John|year=2010|title=A Book|publisher=A Publisher}}
With the script installed, this looks as follows (if you already have the script installed, you will see duplicate messages):
Text[1]
- ^ Smith 2011, p. 9. Harv error: link from CITEREFSmith2011 doesn't point to any citation.
References
- Smith, John (2010). A Book. A Publisher. Harv warning: There is no link pointing to this citation. The anchor is named CITEREFSmith2010.