逃生| (Wiki竖条/管道)在Wiki标记模板中的URL中

mxf*_*xfh 11 url mediawiki escaping url-encoding wiki-markup

是否有可能逃脱并保持非标准| 字符中的字符在表格中的模板Wiki标记中的URL?

{| class="wikitable"
|-
! Test in Table
|-
| [http://example.org/{var1}|{var2}|{var3} Example]
|}
Run Code Online (Sandbox Code Playgroud)

应该在表格单元格中呈现这样的内容

[http://example.org/1|2|3 Example]
Run Code Online (Sandbox Code Playgroud)

并链接到

http://example.org/1|2|3
Run Code Online (Sandbox Code Playgroud)

使用垂直条,不像这样编码

http://example.org/1%7C2%7C3
Run Code Online (Sandbox Code Playgroud)

第三方网站在URL中需要«|»,我会修复服务器端的URL处理,但现在不在我手中.有关解决方法的任何帮助?

我试过这些:

[http://example.org/1|2|3 Example] doesn't work within a table   
[http://example.org/{var1}|{var2}|{var3} Example] works in tables
Run Code Online (Sandbox Code Playgroud)

但是两者都创建了有效的标准URL,其中垂直条正确地URL编码为%7C,如上所述,我想阻止它.

Ben*_*nMQ 5

没有附加扩展支持的外部链接只能通过[url description]语法或普通URL本身生成.虽然如skalee所述,您可以使用{{!}}或其他方法来防止管道符号被解释为Wikitext语法的一部分,最终链接将始终被编码.

没有扩展的帮助,快速解决方案将是JavaScript.(如果它在您自己的MediaWiki网站上,那将非常简单.MediaWiki:Common.js包含将为所有用户加载的JavaScript).