Is it possible to escape and keep the nonstandard | character as is in an URL in a template Wiki Markup within a table?
{| class="wikitable"
|-
! Test in Table
|-
| [http://example.org/{var1}|{var2}|{var3} Example]
|}
Should render something like this in the table cell
[http://example.org/1|2|3 Example]
and link to
http://example.org/1|2|3
with the vertical bars as is and not encoded like this
http://example.org/1%7C2%7C3
The 3rd party website requires «|» in the URL, I would fix the URL handling on the server side but that is out of my hands for now. Any help on a workaround?
I tried these:
[http://example.org/1|2|3 Example] doesn't work within a table
[http://example.org/{var1}|{var2}|{var3} Example] works in tables
but both create valid standard URLs where the vertical bar is properly URL encoded as %7C like above which I would like to prevent.
On GitHub, the markdown escape \| works. People jump to HTML too fast without trying escaping the markdown. As of March 2019, in Gitlab Wikis, you still need to use " | " inside the markup code. Still not supported by Bitbucket see bitbucket.org/site/master/issues/17106/…
The markup language called wikitext, also known as wiki markup or wikicode, consists of the syntax and keywords used by the MediaWiki software to format a page. (Note the lowercase spelling of these terms.) To learn how to see this hypertext markup, and to save an edit, see Help:Editing.
External links, without support from additional extensions, can only be produced by the [url description]
syntax or a plain URL itself.
Although as mentioned by skalee, you can use {{!}}
or other methods to prevent the pipe symbol from being interpreted as part of the Wikitext syntax, the final link will always be encoded.
Without help from extensions, a quick solution would be JavaScript. (If it is on your own MediaWiki site, that would be very simple. MediaWiki:Common.js
contains JavaScript that will be loaded for all users).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With