Page MenuHomePhabricator

Don't allow magic variables named with an embedded colon.
Open, Needs TriagePublic

Description

The wikitext syntax {{FOO:BAR}} can be parsed in one of three ways:

  1. As a transclusion of BAR from the namespace FOO, which could be a localization of (eg) User.
  2. As a transclusion of Template:FOO:BAR (note embedded colon)
  3. As an invocation of the no-hash parser function FOO with the argument BAR
  4. As an invocation of a magic variable named FOO:BAR

To date there are no registered magic variables with an embedded colon in their name, and I'd like to keep it that way, to reduce one-quarter of the ambiguity when parsing this construct.

Event Timeline

Yes.

And neither | nor # nor < nor > nor & or any other stupid idea.

What will say: Within the ASCII range only [_0-9A-Za-z] shall be permitted, and since case-insensitive [_0-9A-Z].

Well, with exception of existing one-character-functions {{!}} and {{=}}.

Pondering a while I would request for any syntactic identifier core:

  • If length 1 then either ! or =.
  • Otherwise at least two characters.
  • First one is to be a letter, generic ASCII A-Z, or Unicode letter for L10N, or ideographic.
  • More letters etc. permitted.
  • Case insensitive by legacy.
  • May contain a digit, like REVISIONDAY2, or Unicode digit for L10N.
  • A _ is permitted inside but neither first nor last, and not subsequent.
  • Function names may be prefixed by # which are not part of the core identifier. Those avoid mixing with any template since a page name cannot start with #.