Last modified: 2006-09-27 18:27:08 UTC
While need to link to other wikimedia projects using querystring (?) and section (#) there's need to encode the section name properly. {{urlencode:}} as well as {{fullurl:}} as well as automatical url encoding in browswer's address bar replaces "á" with "%C3%A1" but the element id in xhtml source is ".C3.A1" Therefore {{hashencode:}} (or choose another name you want) would do just regexp substitution % -> . in {{urlencode:}}d string Example: [{{localurl:Commons:{{{1}}}}}?uselang=cs{{#if: {{{section|}}}|#{{hashencode:{{{section}}}}}}} {{{2}}}] would be able to point to such section on commons page and set the proper language.
Trivial, of course: static function anchorencode( $parser, $s = '' ) { return str_replace('%','.',urlencode( $s )); }
Added "anchorencode" colon function in SVN trunk, r16279.
Reopening - it needs one more replace ("+" → "_"): static function anchorencode( $parser, $s = '' ) { return str_replace('%','.',str_replace('+','_',urlencode( $s ))); }
(In reply to comment #3) > Reopening - it needs one more replace ("+" → "_"): Done in r16675.