Module talk:Footnotes/anchor id list

'''This talk page has been usurped to be a testcases page for development. To talk about this module, please do so at Module talk:Footnotes.'''

There has always been a problem with the and  families of templates: except that every link that is created by these templates is tested at creation, editors don't know if the link works. A remedy for that has been user-scripts like User:Ucucha/HarvErrors. But, not all editors use that script so broken harv links can go undetected for a long time. At the moment, there is prospective bot that would mark broken-link harv templates by adding after the broken-link harv template.

I have another possible solution. I have created a lua module that extracts reference linking data from cs1|2 and vcite templates. I have modified Module:Footnotes/sandbox to use the extracted data to determine if:
 * the harv template does not have a matching citation template
 * more than one citation template matches the harv template

when either of these conditions exists, the harv template emits an error message.

The sandbox module collects various items from the citation templates in the article's wikitext and assembles them into a list of  anchors that each harv template can inspect: Alas, there is a flaw. Because the sandbox module reads article wikitext, and because wrapper templates often set cs1|2 parameter values inside the template, so the sandbox module emits a false error message for wrapped templates ( wraps : So that false error messages don't linger in an article, I have added ignore-err to the harv templates so that false error messages may be suppressed ( wraps :
 * when harv either explicitly (cs1) or implicitly (cs2), the sandbox module builds a  from the cs1|2 parameters:
 * name sources: contributor, author, vauthors, editor and veditors, and their aliases (where they exist)
 * date sources: year, date, publicationdate, and publication-date (in that order).
 * when ref or ref, the sandbox module builds a  from parameters in those templates and adds the result to the list.
 * when CITEREF&lt;name-date>, the sandbox module adds that text (absent the  prefix) to the list.
 * when &lt;anchor-identifier-text>, the sandbox module adds that text to the list – to match a harv template's identical &lt;anchor-identifier-text>
 * when ref is empty or omitted and cs2, the sandbox module acts as if harv
 * when none, the sandbox module skips the citation because  anchor creation specifically suppressed in cs1|2

miscellaneous tests
For these tests, consult the lua logs section of the debug console. To see that, edit this page and click Show preview. At the bottom, click Parser profiling data and then click show under Lua logs.

sfn whitelist
This section has this template:

These four anchor IDs should appear in the  table in the lua logs section of the debug console.

parser functions
This section has this template:

parser functions should not appear in the  table in the lua logs section of the debug console.