https://bugzilla.wikimedia.org/show_bug.cgi?id=48663
--- Comment #7 from [email protected] --- We were just looking at the wiki config to see if we can recognize something as a parser function (instead of a template) and ran into trouble: * Looks like parser functions usage comes in 2 flavours: (a) with the #-prefix: ex: {{#if ..}}, etc. (b) without the #-prefix: ex: {{lc:...}} * config.functionhooks provides a list of parser functions, but that list doesn't distinguish between (a) and (b) above. So, the functionhooks list has an entry for "lc" and an entry of "if" (not #if). So, ostensibly we could have tested if (a) the name starts with a # in which case it is a parser function; OR (b) the name (lc/if/padleft) is present in config.functionhooks. But (b) gets us into trouble because you also have templates like "if". So, {{if...}} ought to be treated as a template and not a parser function. We could then use an additional check to see if there is a ":" in the name to distinguish between {{lc:foo}} and {{lc|foo}}. This could work, but seems a bit hacky and maybe fragile wrt edge cases. If knowing that something is a parser function is essential for VE, then we could implement this check and maybe add a flag in data-mw or add some other way of marking up a parser function. data-mw.target.isPF = true possibly? -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
