Last modified: 2011-04-14 15:12:35 UTC
The parser functions {{lcfirst: and {{ucfirst: do not work when the text they operate on begins with a wikilink. This is the expected behaviour on a textual level, as a wikilink begins with a [ character which is not a letter. However, it is not the behaviour that would be expected on a wiki, since the more useful behaviour in the majority of cases would be that it makes the first character of the link text (not the link target) uppercase or lowercase. E.g. {{ucfirst:[[hello|foo]]}} should be replaced with [[hello|Foo]].
Recommend WONTFIX. ucfirst/lcfist are doing exactly what the documentation says: uppercasing/lowercasing the first character of their input. In this case the first character is [ , which has no uppercase or lowercase variants.
I agree (with Roan Kattouw) they are acting as described. The recommendation of the bug report is to change that action. My opinion FWIW: Changing the action of ucfirst/lcfirst will break current implementation, ruining backward compatibility, and should not be done. However, it would be nice to have a similar function that acts as requested in the bug report. Call it something else and add it to the software (or an extension). It should not only replace {{ucfirstmodulomarkup:[[foo|bar]]}} with [[foo|Bar]] but also e.g. {{ucfirstmodulomarkup:<div><h1><a href="http://example.com/"><span id="foo">bar</span></a></h1></div>}} with <div><h1><a href="http://example.com/"><span id="foo">Bar</span></a></h1></div>.
I agree that modifying the existing behaviour isn't a good idea, but making a new function that does what msh210 describes sounds good.