Page MenuHomePhabricator

Introduce {{~}} parser function
Open, Needs TriagePublicFeature

Description

Feature summary
A parser function {{~}} shall be defined.

  • The one and only result of this function is to respond with a ~ character.

Please see {{!}} and {{=}} for similar wikisyntax escapes.

Use case(s)
For suggested texts, e.g. of preload wikitext, it is necessary to prevent signature generation when publishing the page version with the text pattern, but the target text should get auto-signature.

Various hacks are current practice:

  • ~~<noinclude />~~
  • ~~<includeonly></includeonly>~~
  • Creating a Template:~ for this purpose.

Three or more subsequent ~ will be substituted by partial or full signature when storing the content.

Optional parameter
Following the enWP template familiy approach, one parameter may be used:

  • {{~}}~
  • {{~:3}}~~~ (substituted by user link, perhaps pretty)
  • {{~:4}}~~~~ (substituted by signature on second stage)
  • {{~:5}}~~~~~ (substituted by timestamp)
  • {{~:else}}~ (fallback)

Benefits

  • Avoid hacks and misuse of other syntax.
  • Make provided texts better readable: ~{{~}}~
  • Provide a globally unique solution for a global syntax problem, whether local infrastructure is available or not.

Conflict
If any wiki is already defining a Template:~ that will be overruled.

  • English Wikipedia has one: en:Template:~
  • Fortunately, it produces the same result as the suggested parser function, obviously for the same reasons.
  • No usage will need to be changed, since just the parser function rather than a template will be expanded.
  • There might be other wikis, but usually they use a 1:1 copy of English Wikipedia.
  • Superfluous templates might be deleted.
  • English Wikipedia could still maintain the template approach by Template:1~ which is currently just a redirect.