Last modified: 2011-04-14 15:12:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26636, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24636 - lcfirst and ucfirst parser functions do not work on wikilinks
lcfirst and ucfirst parser functions do not work on wikilinks
Status: NEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-02 18:55 UTC by CodeCat
Modified: 2011-04-14 15:12 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description CodeCat 2010-08-02 18:55: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]].
Comment 1 Roan Kattouw 2010-08-04 11:07:03 UTC
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.
Comment 2 msh210 2010-08-04 14:46:43 UTC
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>.
Comment 3 CodeCat 2010-08-05 16:04:38 UTC
I agree that modifying the existing behaviour isn't a good idea, but making a new function that does what msh210 describes sounds good.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links