Page MenuHomePhabricator

{{=}} should be a parser function
Open, LowPublic

Description

{{=}} is very widely used template used for including "=" in template calls. It seems logical to have it added as a parser function after {{!}} was finally made one.

Event Timeline

Base created this task.Feb 28 2015, 4:13 AM
Base raised the priority of this task from to Needs Triage.
Base updated the task description. (Show Details)
Base added a project: MediaWiki-Core-Team.
Base added a subscriber: Base.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 28 2015, 4:13 AM
Legoktm set Security to None.

Change 193553 had a related patch set uploaded (by Base):
Adding = as a parser function

https://gerrit.wikimedia.org/r/193553

Change 193661 had a related patch set uploaded (by Base):
Enabling subpages for ns0 in uawikimedia

https://gerrit.wikimedia.org/r/193661

Base added a comment.Mar 1 2015, 6:42 AM

(The last patch's unrelated, put wrong bug id by mistake)

Aklapper triaged this task as Low priority.Mar 2 2015, 7:36 AM

I see absolutely no point to having eq as an alias for =. Other than that, I'm for this.

Base added a comment.Mar 3 2015, 10:59 PM

IMHO it's too widely used alias for Template:= (in some wikis it's main name of template) to neglect it. It would be possible to make Template:Eq calling {{=}} but IMHO it's kinda weird. I'm not insisting though, so I'm open to be convinced in case reasonable arguments are given.

I was thinking it {{Eq}} was supposed to be some kind of comparison function…

IMHO {{Eq}} as an alias for {{=}} only stands for English language wikis.

Base added a comment.Mar 3 2015, 11:47 PM

For wikimedia wikis at least in 11 (per https://www.wikidata.org/wiki/Q5406510 and my poor arithmetics skills) Template:Eq is the main name of template and the wikis aren't English language. Some bot or sql query's required to find out how many Template:Eq —> Template:= redirects exist. And information about non-wikimedia wikis would be nice addition if someone has some.

You can include = as param value by using named arguments or just name the unnamed argument (1= pa=ram). No need to have such a template or parser function in my mind.

{{!}} is needed to build a table and there is no way to bypass the parser meaning of this.

Base added a comment.Mar 6 2015, 9:03 AM

Indeed you can. But the template is widely used nevertheless.

You can include = as param value by using named arguments or just name the unnamed argument (1= pa=ram). No need to have such a template or parser function in my mind.

{{!}} is needed to build a table and there is no way to bypass the parser meaning of this.

"|" maybe?

You can include = as param value by using named arguments or just name the unnamed argument (1= pa=ram). No need to have such a template or parser function in my mind.

{{!}} is needed to build a table and there is no way to bypass the parser meaning of this.

"|" maybe?

When you just want the value "|" you can use a html entity, but not when the meaning of the | must be kept for the wiki parser, for example a table syntax, because the | is not decoded to | when it is giving to the table parser (which is okay, because you can have the value "|" also inside a table).

cscott added a subscriber: cscott.EditedJul 10 2015, 9:42 PM

If we're voting, I say {{=}} should be a parser function, but I agree that {{Eq}} is english-specific and shouldn't be built in.

It's really rather crazy how many different ways there are to escape characters in wikitext. I hope to present a large list next week but I might not be smart enough to do the topic proper justice.

That said, {{!}} for ! and {{=}} for = are at least relatively straight-forward and readable. Their uniform use should be encouraged, IMO.

EDIT: whoa, my mistake: {{!}} is for |, not !. Which is too bad, from a consistency standpoint. {{=}} is much better!

This has pending for a long time. Can we get a roll call of positions?

I updated the patch to not contain {{eq}} anymore, which seems to be what everyone but Base wanted.

Base added a comment.Aug 26 2015, 11:14 AM

Can someone run a bot/query to find in how many wikis there is Template:Eq as redirect or main name, please? I do not insist though and absolutely fine with having just =, but I just want to be sure that people realise that it's not in English wikis only that they have Eq. For example I know it first of all from Ukrainian Wikipedia.

Is there any progress on this?

Liuxinyu970226 added a comment.EditedFeb 27 2018, 4:04 AM

@Base I'm afraid that I strongly oppose {{eq}} because of the potential confusion with {{edit request}} (are you really willing all wikis to change that to {{edit protected}}?)

{{eq}} was already discussed in the patch, nobody supported that. I'll change the description, because everybody just writes this, but nobody implements the {{=}} into a good patch

Dvorapa renamed this task from {{=}}/{{Eq}} should be a parser function to {{=}} should be a parser function.Feb 27 2018, 6:09 AM
Dvorapa updated the task description. (Show Details)
Dvorapa edited projects, added Patch-Needs-Improvement; removed Patch-For-Review.
Base added subscribers: siebrand, MaxSem.EditedJun 11 2020, 7:15 PM

@Dvorapa , @siebrand, @MaxSem ,
I have rebased the patch, or basically reapplied the changes since there was some refactoring done over this time. Could you help me with the requirement you had regarding the tests? Having little MW knowledge I wanted to cargo-cult tests for {{!}} but I could not locate those in \MagicVariableTest which is where I assume the tests should be added.

Also, do I need to also create a patch for Parsoid(s)?

Base claimed this task.Jun 11 2020, 7:15 PM
Base added a comment.Jun 12 2020, 10:42 AM

Okay, I guess removing a Template:= mock from tests/parser/parserTests.txt does the job. That is also what was done for Template:! but it is just now that I got the gist what it was all about.

So I still have the question about parsoid.

Also if this is going to be merged, do I need to add it to release notes file as well or someone else does it?

Change 193553 merged by jenkins-bot:
[mediawiki/core@master] Adding = as a parser function

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /193553

At least Dutch Wiktionary uses {{=}} for something different entirely. Other projects may be affected too. It looks like the parser function will override local templates. This patch shouldn't be deployed before wikis have been given a warning through Tech News.

Change 609302 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Revert "Adding = as a parser function"

https://gerrit.wikimedia.org/r/609302

Change 609302 merged by jenkins-bot:
[mediawiki/core@master] Revert "Adding = as a parser function"

https://gerrit.wikimedia.org/r/609302

I will investigate other wikis. This may take some time.

Quick update: several other wikis appear to be affected. I'll give more details later.

AlexisJazz added a comment.EditedJul 4 2020, 12:00 PM

Central on-wiki discussion at https://meta.wikimedia.org/wiki/Equals_sign_parser_function_template_conflicts.

https://als.wikibooks.org/wiki/ redirects to https://als.wikipedia.org/wiki/Buech:Houptsyte. It looks like alswikibooks is maintained in the "Buech" namespace on alswiki.

https://als.wiktionary.org/wiki/ redirects to https://als.wikipedia.org/wiki/Wort:Houptsyte. It looks like alswiktionary is maintained in the "Wort" namespace on alswiki.

  • Used for a purpose other than an equals sign (15):
  • Page is a redirect (8):
    • dsbwiki (plain "=")
    • frwikisource (other)
    • huwiki (=)
    • hywiki (plain "=")
    • oswiki (plain "=")
    • sahwiki (plain "=")
    • tkwiki (plain "=")
    • vepwiki (plain "=")
  • Plain "=" (282): afwiki, afwiktionary, angwiki, arwikinews, arwiki, arwikiquote, arwikisource, arwikiversity, arwiktionary, arzwiki, astwiki, aswiki, avwiki, azbwiki, azwikibooks, azwiki, banwiki, bawikibooks, bawiki, bclwiki, betawikiversity, bewiki, be_x_oldwiki, bgwiki, bgwikiquote, bgwiktionary, bhwiki, bjnwiki, bnwikibooks, bnwiki, bnwikisource, bnwikivoyage, bnwiktionary, bswiki, bugwiki, cawiki, cawikiquote, cawikisource, cdowiki, cewiki, ckbwiki, cowiki, crhwiki, cswiki, cuwiki, cvwiki, cywiki, dawiki, dawiktionary, dewikisource, dewikiversity, dewiktionary, diqwiki, dtywiki, eewiki, elwiki, elwiktionary, enwikibooks, enwiki, enwikiquote, enwikisource, enwikiversity, enwiktionary, eowiki, eowiktionary, eswikibooks, eswiki, eswikisource, eswikiversity, eswikivoyage, eswiktionary, etwiki, euwiki, fawikibooks, fawikinews, fawiki, fawikiquote, fawikisource, fawikivoyage, fawiktionary, fiwiki, fiwiktionary, fowiki, frpwiki, frwiki, frwikivoyage, frwiktionary, fywiktionary, ganwiki, gawiki, glwiki, gomwiki, gotwiki, guwiki, guwiktionary, hakwiki, hawiki, hewikibooks, hewiki, hewikiquote, hewikivoyage, hewiktionary, hifwiki, hiwikibooks, hiwiki, hiwikiversity, hrwiki, hrwikiquote, htwiki, hywikiquote, hywiktionary, iawikibooks, iawiki, iawiktionary, idwiki, idwiktionary, ilowiki, inhwiki, iowiki, itwikibooks, itwiki, itwikiquote, itwikisource, jawikibooks, jawiki, jawikisource, jawikiversity, jvwiktionary, kabwiki, kawiki, kawiktionary, kkwiki, kmwiki, kmwiktionary, knwiki, koiwiki, kowikibooks, kowiki, kowikisource, kowikiversity, krcwiki, kuwiki, kuwiktionary, kwwiki, kywiki, kywiktionary, ladwiki, lawiki, lawikisource, lawiktionary, lezwiki, lijwiki, lowiki, lrcwiki, ltwiki, lvwiki, lvwiktionary, maiwiki, mdfwiki, metawiki, minwiki, miwiki, mkwiki, mkwiktionary, mlwiki, mlwikisource, mnwiki, mrwiki, mswiki, mswiktionary, mtwiki, mwlwiki, myvwiki, mywiki, mywiktionary, mznwiki, nahwiki, nds_nlwiki, ndswiki, ndswiktionary, newiki, newiktionary, newwiki, nlwikibooks, nlwiki, nnwiki, nowiki, nowiktionary, nsowiki, nywiki, ocwiki, orwiki, orwikisource, pamwiki, pawiki, plwikibooks, plwiki, plwiktionary, pnbwiki, pswiki, ptwikibooks, ptwiki, ptwikisource, ptwikiversity, ptwiktionary, quwiki, rowiki, ruwikibooks, ruwikinews, ruwiki, ruwikiquote, ruwikisource, ruwikiversity, sawiki, scnwiki, scowiki, sdwiki, shwiki, simplewiki, siwikibooks, siwiktionary, skwiki, slwiki, sowiki, specieswiki, sqwiki, srwiki, srwiktionary, suwiki, svwikibooks, svwikinews, svwiki, svwikisource, svwikiversity, svwikivoyage, swwiki, tawiki, tcywiki, tewiki, tewiktionary, tgwiki, tgwiktionary, thwikibooks, thwiki, thwikiquote, thwiktionary, tlwiki, tlwiktionary, trwiki, trwiktionary, tswiki, tswiktionary, tyvwiki, udmwiki, ukwikibooks, ukwiki, ukwikiquote, ukwikisource, ukwikivoyage, urwikibooks, urwiki, uzwiki, uzwiktionary, viwikibooks, viwiki, viwikisource, warwiki, wawiki, wowiki, wuuwiki, wikidatawiki, xmfwiki, yiwiki, zh_classicalwiki, zh_min_nanwiki, zhwikibooks, zhwiki, zhwikiquote, zhwikiversity, zhwikivoyage, zhwiktionary, zh_yuewiki
  • Plain "=" in nowiki tags (12): bmwiki, brwiki, commonswiki, crwiki, dewikivoyage, elwikisource, frwikibooks, frwikinews, frwikiversity, gagwiki, itwikivoyage, pcdwiki
  • = (10): chwiki, gdwiki, gdwiktionary, gvwiki, jvwiki, siwiki, svwiktionary, tawikibooks, yowiki, zhwikisource
  • = (1): wawiktionary
  • Template does not exist (364): abwiki, acewiki, adywiki, afwikibooks, afwikiquote, akwiki, alswiki, amwiki, amwiktionary, angwiktionary, anwiki, anwiktionary, arcwiki, arwikibooks, astwiktionary, atjwiki, aywiki, aywiktionary, azwiktionary, barwiki, bat_smgwiki, bewikibooks, bewikiquote, bgwikibooks, bgwikinews, biwiki, bowiki, bowiktionary, bpywiki, brwikiquote, brwikisource, brwiktionary, bswikibooks, bswikinews, bswikiquote, bswikisource, bswiktionary, bxrwiki, cawikibooks, cawikinews, cawiktionary, cbk_zamwiki, cebwiki, chrwiki, chrwiktionary, chywiki, cowiktionary, csbwiki, csbwiktionary, cswikibooks, cswikinews, cswikiquote, cswikisource, cswikiversity, cswiktionary, cvwikibooks, cywikibooks, cywikiquote, cywikisource, cywiktionary, dawikibooks, dawikiquote, dawikisource, dewikibooks, dewikinews, dewiki, dewikiquote, dinwiki, dvwiktionary, dzwiki, elwikibooks, elwikinews, elwikiquote, elwikiversity, elwikivoyage, emlwiki, enwikivoyage, eowikibooks, eowikiquote, eswikinews, eswikiquote, etwikibooks, etwiktionary, euwikibooks, euwikiquote, euwikisource, euwiktionary, extwiki, ffwiki, fiu_vrowiki, fiwikibooks, fiwikinews, fiwikiquote, fiwikisource, fiwikiversity, fiwikivoyage, fjwiki, fjwiktionary, fowiktionary, frrwiki, frwikiquote, furwiki, fywikibooks, fywiki, gawiktionary, glkwiki, glwikibooks, glwikisource, glwiktionary, gnwiki, gnwiktionary, gorwiki, guwikiquote, gvwiktionary, hawiktionary, hawwiki, hewikinews, hiwikivoyage, hiwiktionary, hrwikibooks, hrwikisource, hrwiktionary, hsbwiki, huwikinews, huwikiquote, hywikibooks, hywikisource, idwikibooks, idwikiquote, idwikisource, iewiki, iewiktionary, igwiki, ikwiki, ikwiktionary, iowiktionary, iswikibooks, iswiki, iswikiquote, iswikisource, iswiktionary, itwikinews, itwikiversity, itwiktionary, iuwiki, iuwiktionary, jamwiki, jawikinews, jawikiquote, jbowiki, kaawiki, kawikibooks, kawikiquote, kbdwiki, kbpwiki, kgwiki, kiwiki, kkwikibooks, kkwiktionary, klwiki, klwiktionary, kmwikibooks, knwiktionary, kowikinews, kowikiquote, kowiktionary, kshwiki, kswiki, kswiktionary, kuwikibooks, kuwikiquote, kvwiki, kwwiktionary, kywikibooks, lawikibooks, lawikiquote, lbewiki, lbwiki, lbwikiquote, lbwiktionary, lfnwiki, lgwiki, liwiki, liwikiquote, liwikisource, liwiktionary, lmowiki, lnwiki, lnwiktionary, lowiktionary, ltgwiki, ltwikibooks, ltwikiquote, ltwikisource, ltwiktionary, map_bmswiki, mgwikibooks, mgwiki, mgwiktionary, mhrwiki, miwiktionary, mkwikibooks, mlwikibooks, mlwikiquote, mlwiktionary, mnwiktionary, mrjwiki, mrwikibooks, mrwikiquote, mrwiktionary, mswikibooks, mtwiktionary, nahwiktionary, napwiki, nawiki, nawiktionary, nowikibooks, nowikiquote, newikibooks, nlwikinews, nlwikiquote, nlwikisource, nlwikivoyage, nnwiktionary, novwiki, nowikinews, nrmwiki, ocwikibooks, ocwiktionary, olowiki, omwiki, omwiktionary, pagwiki, papwiki, pawikibooks, pawikisource, pawiktionary, pdcwiki, pflwiki, pihwiki, piwiki, plwikinews, plwikiquote, plwikisource, plwikivoyage, pmswiki, pmswikisource, pnbwiktionary, pntwiki, pswikivoyage, pswiktionary, ptwikinews, ptwikiquote, ptwikivoyage, quwiktionary, rmwiki, rmywiki, rnwiki, roa_rupwiki, roa_rupwiktionary, roa_tarawiki, rowikibooks, rowikinews, rowikiquote, rowikisource, rowikivoyage, rowiktionary, ruewiki, ruwikivoyage, rwwiki, rwwiktionary, sahwikiquote, sawikiquote, sawiktionary, scnwiktionary, scwiki, sdwikinews, sdwiktionary, sewiki, sgwiki, sgwiktionary, shwiktionary, simplewiktionary, skwikibooks, skwikiquote, skwikisource, skwiktionary, slwikibooks, slwikiquote, slwikisource, slwikiversity, slwiktionary, smwiki, smwiktionary, snwiki, sowiktionary, sqwikinews, sqwiktionary, srnwiki, srwikibooks, srwikinews, srwikiquote, srwikisource, sswiki, sswiktionary, stqwiki, stwiki, stwiktionary, suwiktionary, svwikiquote, swwiktionary, szlwiki, tawikinews, tawikiquote, tawiktionary, tetwiki, tewikibooks, tgwikibooks, thwikinews, thwikisource, tiwiki, tiwiktionary, tkwiktionary, tlwikibooks, tnwiki, tnwiktionary, towiki, tpiwiki, tpiwiktionary, trwikibooks, trwikinews, trwikiquote, trwikisource, ttwikibooks, ttwiktionary, tumwiki, twwiki, tywiki, ugwiki, ugwiktionary, ukwikinews, urwikiquote, urwiktionary, vecwiki, vewiki, viwikivoyage, viwiktionary, vlswiki, vowikibooks, vowiki, vowiktionary, wowiktionary, xalwiki, xhwiki, yiwikisource, yiwiktionary, yuewiktionary, zawiki, zawiktionary, zeawiki, zh_min_nanwiktionary, zhwikinews, zuwiki, zuwiktionary

This is unacceptable to ruwiktionary! Please make it configurable.

Pppery awarded a token.Jul 6 2020, 4:44 AM
Base added a comment.Jul 6 2020, 5:19 AM

Fixed ttwiki, it was meant to be = and several articles were broken because of an extra line break.

There definitively should be a parser function for this, but perhaps we have to investigate more about its name

Base removed Base as the assignee of this task.Jul 11 2020, 5:50 PM

If what we come up with is an opt-outable parser function, then I do not have enough experience to do it, please pick this up, someone. (I am open to be taught too :) )

AlexisJazz added a comment.EditedJul 11 2020, 8:35 PM

If what we come up with is an opt-outable parser function, then I do not have enough experience to do it, please pick this up, someone. (I am open to be taught too :) )

I don't know about that. We are making good progress in getting the template renamed or adjusted in affected projects. However, MediaWiki isn't just used by the WMF. I think in the upgrade script (part of MediaWiki installer) a check should be added for the existence of this template, and throw an error and/or offer renaming the template (or disabling the feature) if it exists.

We've discussed this on the parsing team and @cscott will chime in more, but just to get this out early while you are all discussing this here and other forums, we definitely will not support wiki-specific configuration for a parser function. So, that means: if you want {{=}} as a parser function, all wikis will get it. There will not be an option to opt out.

Ahonc added a subscriber: Ahonc.Sat, Jul 25, 6:40 PM

We've discussed this on the parsing team and @cscott will chime in more, but just to get this out early while you are all discussing this here and other forums, we definitely will not support wiki-specific configuration for a parser function. So, that means: if you want {{=}} as a parser function, all wikis will get it. There will not be an option to opt out.

I think that's sane. There are only three WMF projects left that use {{=}} for something else. ukwiktionary is now expected to rename soon (possibly today or tomorrow, depends on when Ahonc responds), sourceswiki will rename it (just pondering over what the new name shall be) leaving just ruwiktionary. I'll ask them again to rename it. If push comes to shove, {{=}} could be replaced with {{Template:=}} in their usage. I don't expect it to come to that though.

Can you and/or @cscott consider the upgrade script for non-WMF wikis?

Can you and/or @cscott consider the upgrade script for non-WMF wikis?

We never created any such script for {{!}}, we just mentioned in it the release notes. I agree that it would be good to have but I wouldn't consider it a blocker.

Can you and/or @cscott consider the upgrade script for non-WMF wikis?

We never created any such script for {{!}}, we just mentioned in it the release notes. I agree that it would be good to have but I wouldn't consider it a blocker.

At least make sure it will be mentioned, and include a a warning. There is no way to search for this. Here are some non-WMF wikis that use Template:= to insert an equal sign:

It's not hard to imagine that there will be some out there using Template:= for something different. And the wikiverse is probably a lot bigger today than it was back when {{!}} was added.

Change 617246 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Tracking category and parser warning for deprecated uses of {{=}}

https://gerrit.wikimedia.org/r/617246

Uploaded a patch to add a tracking category in the next release for anything using Template:=. Then we'd add the parser function to the release after that one, after giving third-party wikis a release cycle's warning time.

We've discussed this on the parsing team and @cscott will chime in more, but just to get this out early while you are all discussing this here and other forums, we definitely will not support wiki-specific configuration for a parser function. So, that means: if you want {{=}} as a parser function, all wikis will get it. There will not be an option to opt out.

To elaborate, briefly: the point of adding {{=}} as a parser function is to allow it to be used as an automatic/reliable escape mechanisms for = characters in template arguments, in a similar way to how {{!}} is used to escape !. It can't be used as a reliable escape mechanism if it is configurable per-site. There are alternative mechanisms, for example using a numeric parameter name, or using heredoc escaping (T114432). If you need to code an alternative in the case where {{=}} is disabled on the site, then you may as well use the alternative in all cases and the motivation for adding {{=}} is reduced.