Help:Parser function: Difference between revisions

Content deleted Content added
LCE1506 (talk | contribs)
m ANCHORENCODE: typo, "Xikimedia" -> "Wikimedia" Foundation
LCE1506 (talk | contribs)
m ANCHORENCODE: typo, "tHe" -> "The"; small spelling fixes
Line 50:
For anchors ''within'' a page use <nowiki>{{anchorencode}}</nowiki> instead of <nowiki>{{urlencode}}</nowiki>. The results of a call to <nowiki>{{anchorencode}}</nowiki> are compatible with intra-page references generated for <nowiki>[[#link]]</nowiki>s, while <nowiki>{{urlencode}}</nowiki>-generated values are not necessarily so.
 
Note that (contrary to urlencode) the encoding made by "anchorencode", which uses the dot charactorcharacter as a prefix before a byte represented in hexadecimal, is not fully reversible. "anchorencode" is then NOT suitable for passing query parameters. However the encoding made by "urlencode" (which uses "%" characters) is not compatible with the more restricted character sets allowed in HTML and XML for ids. tHeThe two encodings also differ in the way they encode the space.
 
Compare:
Line 58:
The encoding made by anchorencode is suitable to give anchor names within pages made with MediaWiki.
 
It is not guaranteed to work with other web sites: if you need to specify an anchor in a page not hosted on a server running MediaWiki, the anchor is not warrantied to work as expected. So, use "anchorencode" only for targettingtargeting a MediaWiki web site, such as those from the Wikimedia Foundation projects.
 
==NS==