Difference between revisions of "Template:Detect singular"
Jump to navigation
Jump to search
imported>Mifter (Adding {{pp-template}} (TW)) |
imported>JJMC89 (handled by {{documentation}}) |
||
| Line 1: | Line 1: | ||
| − | + | {{#ifexpr:({{#invoke:String|find|{{{1|}}}|,}}+{{#invoke:String|find|{{{1|}}}|list}}+{{#invoke:String|find|{{{1|}}}|<%s*br|plain=false}})>0||1}}<noinclude>{{documentation}}</noinclude> | |
Latest revision as of 07:17, 22 March 2019
1
Usage
Used to detect possible lists. Useful for infoboxes, where the label may be singular (e.g., "Nickname:") but the data may be a list. One required parameter (the string to search for a list). Returns 1 if not a list, nil if a possible list.
Examples:
{{Detect singular|Mack the Knife}} → 1
{{Detect singular|Mack the Knife, Joe}} →
{{Detect singular|{{hlist|first|second|third}}}} →
It is not foolproof, however:
{{Detect singular|[[Charles, Prince of Wales]]}} →
{{Detect singular|[[Dave Nellist]]}} →
| The above documentation is transcluded from Template:Detect singular/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |