{{#if: {{{1|}}} | <!-- Check if input is not empty -->
{{#ifexprif: {{#expr: {{#countexplode: {{{1|}}} }} > 1|#|2}} | <!-- Check if there is a '#' key -->
{{#ifexpr: {{#expr: [[{{#explode: {{{1|}}}|#|01}} != #{{#explode: {{{1|}}}|#|2}}|{{{1}}}} |]] <!-- CheckDisplay iflink content before and afterwith '#' key are different -->
[[{{#explode: {{{1|}}}|#|0}} {{#explode: {{{1|}}}|#|1}}|{{'#'}}{{#explode: {{{1|}}}|#|1}}]] <!-- If different, display link with '#' -->
| <!-- Otherwise -->
[[{{#explode: {{{1|}}}|#|0}}#{{#explode: {{{1|}}}|#|1}}]] <!-- Display link with '#' -->