Template:List normalize

From Ring of Brodgar
Revision as of 10:04, 19 September 2021 by MvGulik (talk | contribs) (Fix inner remark hiccup.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Template documentation (for the template shown above, sometimes hidden or invisible)
Copied raw notes from related template.

Set Parameter Space Clean-up.//List_Cleanup.

  • Input: string/list, intended to be used in SMW '#set' with 'sep=,' parameter.
  • Optional list delimiter. Default is comma.
  • Turns consecutive inner-spaces into one. (current max:4)
  • Turns consecutive inner-delimiters into one. (current max:4)
  • Strips leading/trailing delimiters. (current max:3)
  • (Leading and trailing spaces are generally ignored/stripped by default.)
  • Side effect: Converts underscores in input to spaces in output. (after cleanup, not before!)
    • Not sure yet about turning underscores to spaces at the start.
    • Related code:
#replace:{{
#replace:,{{{1|}}},||•
}}|_|•
  • Open/issue: line-breaks. (other list-stuff trips over them)