4

我注意到使用带有等号的链接似乎不能正常工作(当链接放在{{missing information}}模板内时)。有没有办法解决这个限制,以便在 MediaWiki 模板中包含等号链接?

{{missing information|[https://www.google.com/search?q=google+search+test This link has an equals sign in it, and the template is not displaying properly.]}}

{{missing information|[https://www.google.com/ This link has no equals sign in it, and it's working properly.]}}

4

2 回答 2

8

这是因为 MediaWiki 将其视为带有名称的参数[https://www.google.com/search?q(该值是字符串参数后面的其余部分=)。您可以通过使用编号参数来解决此问题:

{{missing information|1=[https://www.google.com/search?q=google+search+test This link has an equals sign in it, and the template is not displaying properly.]}}

如果您有更多参数并且只有其中一些有问题,事情会变得更加复杂,我不确定它是如何工作的。但是对所有内容使用编号参数应该可以。

于 2013-02-05T06:59:33.450 回答
0

您可以使用Template:=,根据其文档“允许在未命名的模板参数中使用“=”,否则它将被视为键/值分隔符。例如,这有效:

{{missing information|[https://www.google.com/search?q{{=}}cool Cool!]}}

于 2020-03-31T18:47:09.980 回答