User:PerfektesChaos/js/WikiSyntaxTextMod/flow/template

WikiSyntaxTextMod → Syntax polishing → Step 3

The third step of syntax polishing covers all issues in context of template and page transclusion. This is anything in curly brackets …  as well as parser functions and similar syntax elements.

Formatting

 * A third  indicates a parameter value; this sequence will be ignored.
 * Spaces between  and identifier are removed.
 * Many parser functions can be detected by identifier terminated by   (looks like containing a colon).
 * For DEFAULTSORT and DISPLAYTITLE or their equivalences special treatment is triggered.
 * Names of parser functions must not contain spaces but underscore; in return no percent sign or brackets.
 * Other parser functions, variables and their localization are identified by positive list.
 * If parser functions or variables have been detected they are turned into common and unique upcase spelling.
 * If it is obviously neither a parser function nor a variable the identifier is treated as name of a template (or other transcluded page).
 * It is proofed to be a template name if the identifier is beginning before colon with the name space designator  or localized counterpart. Such name space prefix will be removed.
 * Names of templates are decoded like a wikilink.
 * Under project specific conditions the first character is capitalized or downcased.
 * If it is a well known standard template in general or for the current project appropriate action is taken.
 * If there is a user defined wikilink modification or respective user defined template modification this will be executed.
 * If there is a need the name of the template is protected against undesired changes.

Inner analysis
Especially if there is special interest in a template, well known or user defined or by project standardmäßig subject to changes and evaluation, the template is split syntactically and parameters are evaluated.
 * Nested templates in template are always separated.
 * During parameter analysis wikilinks get separated, which enables assignment of pipe symbols  to wikilinks or parameter separation.
 * As result of parameter analysis a list is available which parameters with which name and value is present and how they are formatted in detail by spaces and new lines.

DISPLAYTITLE
In main space pages (articles) an entirely redundant …  or localized variant is removed. This happens only if the value is completely identical with the page title and there are no special characters which could be interpreted syntactically.

Standard templates
While every project might use a different definition for some template types a default behaviour is provided:

Sister projects
,  as well as    and   etc. are standardized and simplified.

Depending on availability in project a combination of  and   is turned into   or   etc.

ISSN
In a Template:ISSN invalid number format is adjusted and remaining bad data causes an error message.

Code parameters
For all wiki projects template parameters with the following names will be checked (upper and lower case doesn’t matter): The formal permissibility is tested; if possible and necessary the value will be formatted.
 * DOI, ISBN, ISSN, PMID, VIAF (in future: LCCN)
 * Those algorithms are subject to further extension.

&#91; German page &#93;