Template:List normalize/doc

From Ring of Brodgar
Jump to navigation Jump to search
Pre-process bare-text list.
  • Turns consecutive inner-spaces into one. (current max:4) (All leading and trailing spaces are always ditched by used MW-process)
  • Turns consecutive inner-delimiters into one. (current max:4) (Includes empty/blank list entries.)
  • Strips leading/trailing delimiters. (current max:3)
General use.
{{list_normalize|<Input-list>}}
  • input-list: Delimited strings(page names) list.
Optional.
  • Delimiter to be used. Default is a comma. (Single character expected, but not checked or enforced.)
{{list_normalize|<Input-list>|<Delimiter>}} -- Order dependent.
  • lt: Leading string to be added to all names in list.
  • tt: Trailing string to be added to all names in list.
{{list_normalize|<Input-list>|lt=<Leading text>|tt=<Trailing text>}}
Additional notes.
  • Can directly be used in SMW '#set' with 'sep=,' parameter.
  • Side effect: Converts underscores in input to spaces in output. (After main process, not before!)
    • Not sure yet about turning underscores to spaces at the start.
  • Open-issue: Real line-breaks in list. Other list-stuff trips over them.