Equals signs in Wikipedia template parameters won't display properly

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 16:38:29

问题


I've noticed that using links with equals signs in them doesn't seem to work properly (when the link is placed inside the {{missing information}} template). Is there any way to work around this limitation so that links with equals signs can be included inside MediaWiki templates?

{{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.]}}


回答1:


This is because MediaWiki treats this as a parameter with the name [https://www.google.com/search?q (the value is the rest of the string parameter after =). You can work around that by using a numbered parameter:

{{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.]}}

Things get more complicated if you have more parameters and only some of them are problematic, I'm not sure how does that work. But using numbered parameters for everything should work.



来源:https://stackoverflow.com/questions/14701495/equals-signs-in-wikipedia-template-parameters-wont-display-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!